Description:"Optional configuration for the volume type",
Optional:true,
MaxItems:1,
Elem:&schema.Resource{
Schema:map[string]*schema.Schema{
"no_copy":&schema.Schema{
Type:schema.TypeBool,
Description:"Populate volume with data from the target",
Optional:true,
},
"labels":&schema.Schema{
Type:schema.TypeMap,
Description:"User-defined key/value metadata",
Optional:true,
Elem:&schema.Schema{Type:schema.TypeString},
},
"driver_name":&schema.Schema{
Type:schema.TypeString,
Description:"Name of the driver to use to create the volume.",
Optional:true,
},
"driver_options":&schema.Schema{
Type:schema.TypeMap,
Description:"key/value map of driver specific options",
Optional:true,
Elem:&schema.Schema{Type:schema.TypeString},
},
},
},
},
"tmpfs_options":&schema.Schema{
Type:schema.TypeList,
Description:"Optional configuration for the tmpfs type",
Optional:true,
MaxItems:1,
Elem:&schema.Resource{
Schema:map[string]*schema.Schema{
"size_bytes":&schema.Schema{
Type:schema.TypeInt,
Description:"The size for the tmpfs mount in bytes",
Optional:true,
},
"mode":&schema.Schema{
Type:schema.TypeInt,
Description:"The permission mode for the tmpfs mount in an integer",
Optional:true,
},
},
},
},
},
},
},
"stop_signal":&schema.Schema{
Type:schema.TypeString,
Description:"Signal to stop the container",
Optional:true,
},
"stop_grace_period":&schema.Schema{
Type:schema.TypeString,
Description:"Amount of time to wait for the container to terminate before forcefully removing it (ms|s|m|h)",
Optional:true,
Computed:true,
ValidateFunc:validateDurationGeq0(),
},
"healthcheck":&schema.Schema{
Type:schema.TypeList,
Description:"A test to perform to check that the container is healthy",
MaxItems:1,
Optional:true,
Computed:true,
Elem:&schema.Resource{
Schema:map[string]*schema.Schema{
"test":&schema.Schema{
Type:schema.TypeList,
Description:"The test to perform as list",
Required:true,
Elem:&schema.Schema{Type:schema.TypeString},
},
"interval":&schema.Schema{
Type:schema.TypeString,
Description:"Time between running the check (ms|s|m|h)",
Optional:true,
Default:"0s",
ValidateFunc:validateDurationGeq0(),
},
"timeout":&schema.Schema{
Type:schema.TypeString,
Description:"Maximum time to allow one check to run (ms|s|m|h)",
Optional:true,
Default:"0s",
ValidateFunc:validateDurationGeq0(),
},
"start_period":&schema.Schema{
Type:schema.TypeString,
Description:"Start period for the container to initialize before counting retries towards unstable (ms|s|m|h)",
Optional:true,
Default:"0s",
ValidateFunc:validateDurationGeq0(),
},
"retries":&schema.Schema{
Type:schema.TypeInt,
Description:"Consecutive failures needed to report unhealthy",
Optional:true,
Default:0,
ValidateFunc:validateIntegerGeqThan(0),
},
},
},
},
"hosts":&schema.Schema{
Type:schema.TypeSet,
Description:"A list of hostname/IP mappings to add to the container's hosts file.",
Optional:true,
ForceNew:true,
Elem:&schema.Resource{
Schema:map[string]*schema.Schema{
"ip":&schema.Schema{
Type:schema.TypeString,
Required:true,
ForceNew:true,
},
"host":&schema.Schema{
Type:schema.TypeString,
Required:true,
ForceNew:true,
},
},
},
},
"dns_config":&schema.Schema{
Type:schema.TypeList,
Description:"Specification for DNS related configurations in resolver configuration file (resolv.conf)",
MaxItems:1,
Optional:true,
Computed:true,
Elem:&schema.Resource{
Schema:map[string]*schema.Schema{
"nameservers":&schema.Schema{
Type:schema.TypeList,
Description:"The IP addresses of the name servers",
Required:true,
Elem:&schema.Schema{Type:schema.TypeString},
},
"search":&schema.Schema{
Type:schema.TypeList,
Description:"A search list for host-name lookup",
Optional:true,
Elem:&schema.Schema{Type:schema.TypeString},
},
"options":&schema.Schema{
Type:schema.TypeList,
Description:"A list of internal resolver variables to be modified (e.g., debug, ndots:3, etc.)",
Optional:true,
Elem:&schema.Schema{Type:schema.TypeString},
},
},
},
},
"secrets":&schema.Schema{
Type:schema.TypeSet,
Description:"References to zero or more secrets that will be exposed to the service",
Optional:true,
Elem:&schema.Resource{
Schema:map[string]*schema.Schema{
"secret_id":&schema.Schema{
Type:schema.TypeString,
Description:"ID of the specific secret that we're referencing",
Required:true,
},
"secret_name":&schema.Schema{
Type:schema.TypeString,
Description:"Name of the secret that this references, but this is just provided for lookup/display purposes. The config in the reference will be identified by its ID",
Optional:true,
},
"file_name":&schema.Schema{
Type:schema.TypeString,
Description:"Represents the final filename in the filesystem",
Required:true,
},
},
},
},
"configs":&schema.Schema{
Type:schema.TypeSet,
Description:"References to zero or more configs that will be exposed to the service",
Optional:true,
Elem:&schema.Resource{
Schema:map[string]*schema.Schema{
"config_id":&schema.Schema{
Type:schema.TypeString,
Description:"ID of the specific config that we're referencing",
Required:true,
},
"config_name":&schema.Schema{
Type:schema.TypeString,
Description:"Name of the config that this references, but this is just provided for lookup/display purposes. The config in the reference will be identified by its ID",
Optional:true,
},
"file_name":&schema.Schema{
Type:schema.TypeString,
Description:"Represents the final filename in the filesystem",
Description:"Delay between restart attempts (ms|s|m|h)",
Optional:true,
ValidateFunc:validateDurationGeq0(),
},
"max_attempts":&schema.Schema{
Type:schema.TypeInt,
Description:"Maximum attempts to restart a given container before giving up (default value is 0, which is ignored)",
Optional:true,
ValidateFunc:validateIntegerGeqThan(0),
},
"window":&schema.Schema{
Type:schema.TypeString,
Description:"The time window used to evaluate the restart policy (default value is 0, which is unbounded) (ms|s|m|h)",
Optional:true,
ValidateFunc:validateDurationGeq0(),
},
},
},
},
"placement":&schema.Schema{
Type:schema.TypeList,
Description:"The placement preferences",
Optional:true,
Computed:true,
MaxItems:1,
Elem:&schema.Resource{
Schema:map[string]*schema.Schema{
"constraints":&schema.Schema{
Type:schema.TypeSet,
Description:"An array of constraints. e.g.: node.role==manager",
Optional:true,
Elem:&schema.Schema{Type:schema.TypeString},
Set:schema.HashString,
},
"prefs":&schema.Schema{
Type:schema.TypeSet,
Description:"Preferences provide a way to make the scheduler aware of factors such as topology. They are provided in order from highest to lowest precedence, e.g.: spread=node.role.manager",
Optional:true,
Elem:&schema.Schema{Type:schema.TypeString},
Set:schema.HashString,
},
"platforms":&schema.Schema{
Type:schema.TypeSet,
Description:"Platforms stores all the platforms that the service's image can run on",
Optional:true,
Elem:&schema.Resource{
Schema:map[string]*schema.Schema{
"architecture":&schema.Schema{
Type:schema.TypeString,
Description:"The architecture, e.g. amd64",
Required:true,
},
"os":&schema.Schema{
Type:schema.TypeString,
Description:"The operation system, e.g. linux",
Required:true,
},
},
},
},
},
},
},
"force_update":&schema.Schema{
Type:schema.TypeInt,
Description:"A counter that triggers an update even if no relevant parameters have been changed. See https://github.com/docker/swarmkit/blob/master/api/specs.proto#L126",
Optional:true,
Computed:true,
ValidateFunc:validateIntegerGeqThan(0),
},
"runtime":&schema.Schema{
Type:schema.TypeString,
Description:"Runtime is the type of runtime specified for the task executor. See https://github.com/moby/moby/blob/master/api/types/swarm/runtime.go",
Description:"Ids of the networks in which the container will be put in.",
Optional:true,
Elem:&schema.Schema{Type:schema.TypeString},
Set:schema.HashString,
},
"log_driver":&schema.Schema{
Type:schema.TypeList,
Description:"Specifies the log driver to use for tasks created from this spec. If not present, the default one for the swarm will be used, finally falling back to the engine default if not specified",
MaxItems:1,
Optional:true,
Elem:&schema.Resource{
Schema:map[string]*schema.Schema{
"name":&schema.Schema{
Type:schema.TypeString,
Description:"The logging driver to use: one of none|json-file|syslog|journald|gelf|fluentd|awslogs|splunk|etwlogs|gcplogs",