.. _community.aws.ecs_taskdefinition_module: ******************************** community.aws.ecs_taskdefinition ******************************** **register a task definition in ecs** Version added: 1.0.0 .. contents:: :local: :depth: 1 Synopsis -------- - Registers or deregisters task definitions in the Amazon Web Services (AWS) EC2 Container Service (ECS). Requirements ------------ The below requirements are needed on the host that executes this module. - python >= 3.6 - boto3 >= 1.15.0 - botocore >= 1.18.0 Parameters ---------- .. raw:: html
| Parameter | Choices/Defaults | Comments | |||
|---|---|---|---|---|---|
|
arn
string
|
The ARN of the task description to delete.
|
||||
|
aws_access_key
string
|
AWS access key. If not set then the value of the AWS_ACCESS_KEY_ID, AWS_ACCESS_KEY or EC2_ACCESS_KEY environment variable is used.If profile is set this parameter is ignored.
Passing the aws_access_key and profile options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.
aliases: ec2_access_key, access_key |
||||
|
aws_ca_bundle
path
|
The location of a CA Bundle to use when validating SSL certificates.
Not used by boto 2 based modules.
Note: The CA Bundle is read 'module' side and may need to be explicitly copied from the controller if not run locally.
|
||||
|
aws_config
dictionary
|
A dictionary to modify the botocore configuration.
Parameters can be found at https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html#botocore.config.Config.
Only the 'user_agent' key is used for boto modules. See http://boto.cloudhackers.com/en/latest/boto_config_tut.html#boto for more boto configuration.
|
||||
|
aws_secret_key
string
|
AWS secret key. If not set then the value of the AWS_SECRET_ACCESS_KEY, AWS_SECRET_KEY, or EC2_SECRET_KEY environment variable is used.If profile is set this parameter is ignored.
Passing the aws_secret_key and profile options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.
aliases: ec2_secret_key, secret_key |
||||
|
containers
list
/ elements=dictionary
/ required
|
A list of containers definitions.
See https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/ecs.html for a complete list of parameters.
|
||||
|
command
list
|
The command that is passed to the container.
|
||||
|
cpu
integer
|
The number of cpu units reserved for the container.
|
||||
|
dependsOn
list
/ elements=dictionary
|
The dependencies defined for container startup and shutdown.
When a dependency is defined for container startup, for container shutdown it is reversed.
|
||||
|
condition
string
/ required
|
|
The dependency condition of the container.
|
|||
|
containerName
string
/ required
|
The name of a container.
|
||||
|
disableNetworking
boolean
|
|
When this parameter is
True, networking is disabled within the container. |
|||
|
dnsSearchDomains
list
|
A list of DNS search domains that are presented to the container.
This parameter is not supported for Windows containers.
|
||||
|
dnsServers
list
|
A list of DNS servers that are presented to the container.
This parameter is not supported for Windows containers.
|
||||
|
dockerLabels
dictionary
|
A key/value map of labels to add to the container.
|
||||
|
dockerSecurityOptions
list
|
A list of strings to provide custom labels for SELinux and AppArmor multi-level security systems.
This parameter is not supported for Windows containers.
|
||||
|
entryPoint
string
|
The entry point that is passed to the container.
|
||||
|
environment
list
/ elements=dictionary
|
The environment variables to pass to a container.
|
||||
|
name
string
|
The name of the key-value pair.
|
||||
|
value
string
|
The value of the key-value pair.
|
||||
|
environmentFiles
list
/ elements=dictionary
|
A list of files containing the environment variables to pass to a container.
|
||||
|
type
string
|
The file type to use. The only supported value is
s3. |
||||
|
value
string
|
The Amazon Resource Name (ARN) of the Amazon S3 object containing the environment variable file.
|
||||
|
essential
boolean
|
|
If essential=True, and the container fails or stops for any reason, all other containers that are part of the task are stopped.
|
|||
|
extraHosts
list
/ elements=dictionary
|
A list of hostnames and IP address mappings to append to the /etc/hosts file on the container.
This parameter is not supported for Windows containers or tasks that use network_mode=awsvpc.
|
||||
|
hostname
string
|
The hostname to use in the /etc/hosts entry.
|
||||
|
ipAddress
string
|
The IP address to use in the /etc/hosts entry.
|
||||
|
healthCheck
dictionary
|
The health check command and associated configuration parameters for the container.
|
||||
|
hostname
string
|
The hostname to use for your container.
This parameter is not supported if network_mode=awsvpc.
|
||||
|
image
string
|
The image used to start a container.
|
||||
|
interactive
boolean
|
|
When interactive=True, it allows to deploy containerized applications that require stdin or a tty to be allocated.
|
|||
|
links
list
|
Allows containers to communicate with each other without the need for port mappings.
This parameter is only supported if network_mode=bridge.
|
||||
|
linuxParameters
dictionary
|
Linux-specific modifications that are applied to the container, such as Linux kernel capabilities.
|
||||
|
capabilities
dictionary
|
The Linux capabilities for the container that are added to or dropped from the default configuration provided by Docker.
|
||||
|
add
list
|
|
The Linux capabilities for the container that have been added to the default configuration provided by Docker.
If launch_type=FARGATE, this parameter is not supported.
|
|||
|
drop
list
|
|
The Linux capabilities for the container that have been removed from the default configuration provided by Docker.
|
|||
|
devices
list
/ elements=dictionary
|
Any host devices to expose to the container.
If launch_type=FARGATE, this parameter is not supported.
|
||||
|
containerPath
string
|
The path inside the container at which to expose the host device.
|
||||
|
hostPath
string
/ required
|
The path for the device on the host container instance.
|
||||
|
permissions
list
|
The explicit permissions to provide to the container for the device.
|
||||
|
initProcessEnabled
boolean
|
|
Run an init process inside the container that forwards signals and reaps processes.
|
|||
|
maxSwap
integer
|
The total amount of swap memory (in MiB) a container can use.
If launch_type=FARGATE, this parameter is not supported.
|
||||
|
sharedMemorySize
integer
|
The value for the size (in MiB) of the /dev/shm volume.
If launch_type=FARGATE, this parameter is not supported.
|
||||
|
swappiness
integer
|
This allows you to tune a container's memory swappiness behavior.
If launch_type=FARGATE, this parameter is not supported.
|
||||
|
tmpfs
list
/ elements=dictionary
|
The container path, mount options, and size (in MiB) of the tmpfs mount.
If launch_type=FARGATE, this parameter is not supported.
|
||||
|
containerPath
string
/ required
|
The absolute file path where the tmpfs volume is to be mounted.
|
||||
|
mountOptions
list
|
|
The list of tmpfs volume mount options.
|
|||
|
size
integer
/ required
|
The size (in MiB) of the tmpfs volume.
|
||||
|
logConfiguration
dictionary
|
The log configuration specification for the container.
|
||||
|
logDriver
string
|
The log driver to use for the container.
For tasks on AWS Fargate, the supported log drivers are
awslogs, splunk, and awsfirelens.For tasks hosted on Amazon EC2 instances, the supported log drivers are
awslogs, fluentd, gelf, json-file, journald, logentries, syslog, splunk, and awsfirelens. |
||||
|
memory
integer
|
The amount (in MiB) of memory to present to the container.
|
||||
|
memoryReservation
integer
|
The soft limit (in MiB) of memory to reserve for the container.
|
||||
|
mountPoints
list
/ elements=dictionary
|
The mount points for data volumes in your container.
|
||||
|
containerPath
string
|
The path on the container to mount the host volume at.
|
||||
|
readOnly
boolean
|
|
If this value is
True, the container has read-only access to the volume.If this value is
False, then the container can write to the volume. |
|||
|
sourceVolume
string
|
The name of the volume to mount.
|
||||
|
name
string
|
The name of a container.
|
||||
|
options
string
|
The configuration options to send to the log driver.
|
||||
|
portMappings
list
/ elements=dictionary
|
The list of port mappings for the container.
|
||||
|
containerPort
integer
|
The port number on the container that is bound to the user-specified or automatically assigned host port.
|
||||
|
hostPort
integer
|
The port number on the container instance to reserve for your container.
|
||||
|
protocol
string
|
|
The protocol used for the port mapping.
|
|||
|
privileged
boolean
|
|
When this parameter is
True, the container is given elevated privileges on the host container instance. |
|||
|
pseudoTerminal
boolean
|
|
When this parameter is
True, a TTY is allocated. |
|||
|
readonlyRootFilesystem
boolean
|
|
When this parameter is
True, the container is given read-only access to its root file system. |
|||
|
repositoryCredentials
dictionary
|
The private repository authentication credentials to use.
|
||||
|
credentialsParameter
string
/ required
|
The Amazon Resource Name (ARN) of the secret containing the private repository credentials.
|
||||
|
resourceRequirements
list
|
The type and amount of a resource to assign to a container.
The only supported resource is a
GPU. |
||||
|
secretOptions
list
/ elements=dictionary
|
The secrets to pass to the log configuration.
|
||||
|
name
string
|
The name of the secret.
|
||||
|
valueFrom
string
|
The secret to expose to the container.
|
||||
|
secrets
list
/ elements=dictionary
|
The secrets to pass to the container.
|
||||
|
name
string
/ required
|
The value to set as the environment variable on the container.
|
||||
|
size
string
/ required
|
The secret to expose to the container.
|
||||
|
startTimeout
integer
|
Time duration (in seconds) to wait before giving up on resolving dependencies for a container.
|
||||
|
stopTimeout
integer
|
Time duration (in seconds) to wait before the container is forcefully killed if it doesn't exit normally on its own.
|
||||
|
systemControls
list
|
A list of namespaced kernel parameters to set in the container.
|
||||
|
ulimits
list
/ elements=dictionary
|
A list of ulimits to set in the container.
This parameter is not supported for Windows containers.
|
||||
|
hardLimit
integer
|
The hard limit for the ulimit type.
|
||||
|
name
string
|
|
The type of the ulimit.
|
|||
|
softLimit
integer
|
The soft limit for the ulimit type.
|
||||
|
user
string
|
The user to use inside the container.
This parameter is not supported for Windows containers.
|
||||
|
volumesFrom
list
/ elements=dictionary
|
Data volumes to mount from another container.
|
||||
|
readOnly
boolean
|
|
If this value is
True, the container has read-only access to the volume.If this value is
False, then the container can write to the volume. |
|||
|
sourceContainer
string
|
The name of another container within the same task definition from which to mount volumes.
|
||||
|
workingDirectory
string
|
The working directory in which to run commands inside the container.
|
||||
|
cpu
string
|
The number of cpu units used by the task. If launch_type=EC2, this field is optional and any value can be used.
If launch_type=FARGATE, this field is required and you must use one of
256, 512, 1024, 2048, 4096. |
||||
|
debug_botocore_endpoint_logs
boolean
|
|
Use a botocore.endpoint logger to parse the unique (rather than total) "resource:action" API calls made during a task, outputing the set to the resource_actions key in the task results. Use the aws_resource_action callback to output to total list made during a playbook. The ANSIBLE_DEBUG_BOTOCORE_LOGS environment variable may also be used.
|
|||
|
ec2_url
string
|
URL to use to connect to EC2 or your Eucalyptus cloud (by default the module will use EC2 endpoints). Ignored for modules where region is required. Must be specified for all other modules if region is not used. If not set then the value of the EC2_URL environment variable, if any, is used.
aliases: aws_endpoint_url, endpoint_url |
||||
|
execution_role_arn
string
|
The Amazon Resource Name (ARN) of the task execution role that the Amazon ECS container agent and the Docker daemon can assume.
|
||||
|
family
string
|
A Name that would be given to the task definition.
|
||||
|
force_create
boolean
|
|
Always create new task definition.
|
|||
|
launch_type
string
|
|
The launch type on which to run your task.
|
|||
|
memory
string
|
The amount (in MiB) of memory used by the task. If launch_type=EC2, this field is optional and any value can be used.
If launch_type=FARGATE, this field is required and is limited by the CPU.
|
||||
|
network_mode
string
|
|
The Docker networking mode to use for the containers in the task.
Windows containers must use network_mode=default, which will utilize docker NAT networking.
Setting network_mode=default for a Linux container will use
bridge mode. |
|||
|
placement_constraints
list
/ elements=dictionary
added in 2.1.0
|
Placement constraint objects to use for the task.
You can specify a maximum of 10 constraints per task.
Task placement constraints are not supported for tasks run on Fargate.
|
||||
|
expression
string
|
A cluster query language expression to apply to the constraint.
|
||||
|
type
string
|
The type of constraint.
|
||||
|
profile
string
|
Using profile will override aws_access_key, aws_secret_key and security_token and support for passing them at the same time as profile has been deprecated.
aws_access_key, aws_secret_key and security_token will be made mutually exclusive with profile after 2022-06-01.
aliases: aws_profile |
||||
|
region
string
|
The AWS region to use. If not specified then the value of the AWS_REGION or EC2_REGION environment variable, if any, is used. See http://docs.aws.amazon.com/general/latest/gr/rande.html#ec2_region
aliases: aws_region, ec2_region |
||||
|
revision
integer
|
A revision number for the task definition.
|
||||
|
security_token
string
|
AWS STS security token. If not set then the value of the AWS_SECURITY_TOKEN or EC2_SECURITY_TOKEN environment variable is used.If profile is set this parameter is ignored.
Passing the security_token and profile options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.
aliases: aws_security_token, access_token |
||||
|
state
string
/ required
|
|
State whether the task definition should exist or be deleted.
|
|||
|
task_role_arn
string
|
The Amazon Resource Name (ARN) of the IAM role that containers in this task can assume. All containers in this task are granted the permissions that are specified in this role.
|
||||
|
validate_certs
boolean
|
|
When set to "no", SSL certificates will not be validated for communication with the AWS APIs.
|
|||
|
volumes
list
/ elements=dictionary
|
A list of names of volumes to be attached.
|
||||
|
name
string
/ required
|
The name of the volume.
|
||||
Your application is now running on a container in Amazon ECS.
' > top; /bin/date > date ; echo '| Key | Returned | Description |
|---|---|---|
|
taskdefinition
dictionary
|
always |
a reflection of the input parameters
|