awscc_ecs_task_definition (Resource)

Registers a new task definition from the supplied family and containerDefinitions. Optionally, you can add data volumes to your containers with the volumes parameter. For more information about task definition parameters and defaults, see Amazon ECS Task Definitions in the Amazon Elastic Container Service Developer Guide. You can specify a role for your task with the taskRoleArn parameter. When you specify a role for a task, its containers can then use the latest versions of the CLI or SDKs to make API requests to the AWS services that are specified in the policy that's associated with the role. For more information, see IAM Roles for Tasks in the Amazon Elastic Container Service Developer Guide. You can specify a Docker networking mode for the containers in your task definition with the networkMode parameter. The available network modes correspond to those described in Network settings in the Docker run reference. If you specify the awsvpc network mode, the task is allocated an elastic network interface, and you must specify a NetworkConfiguration when you create a service or run a task with the task definition. For more information, see Task Networking in the Amazon Elastic Container Service Developer Guide. In the following example or examples, the Authorization header contents (AUTHPARAMS) must be replaced with an AWS Signature Version 4 signature. For more information, see Signature Version 4 Signing Process in the General Reference. You only need to learn how to sign HTTP requests if you intend to create them manually. When you use the or one of the SDKs to make requests to AWS, these tools automatically sign the requests for you, with the access key that you specify when you configure the tools. When you use these tools, you don't have to sign requests yourself.

Schema

Optional

Nested Schema for container_definitions.depends_on

Optional: md5-5c23337a7f952fa7bac56fcabe497935

Nested Schema for container_definitions.environment

Optional: md5-c63e95945c16e8b35e75d1e08f3ebc14

Nested Schema for container_definitions.environment_files

Optional: md5-e8c2e3f600f98bd0ea0ba8d7daaedd8c

Nested Schema for container_definitions.extra_hosts

Optional: md5-b950c4ba7c9d2c9d7c552871dff029bf

Nested Schema for container_definitions.firelens_configuration

Optional: md5-ec71975c2149d0e1d09d247f817ce0b9

Nested Schema for container_definitions.health_check

Optional: md5-645414d2e9b636983860fcbc69ff6528

Nested Schema for container_definitions.linux_parameters

Optional: md5-0f1f6e789e78837ac703786b6e014a0f

Nested Schema for container_definitions.linux_parameters.capabilities

Optional: md5-d8a3165e3c3494129618339adf82947f

Nested Schema for container_definitions.linux_parameters.devices

Optional: md5-49af04742ac5c330c9c924f50ef6243b

Nested Schema for container_definitions.linux_parameters.tmpfs

Required: md5-7c1ab626d469219224e9fadeeee1acb4 Optional: md5-4238d91012fb5ec508a9e9c8bd858143

Nested Schema for container_definitions.log_configuration

Required: md5-c399f6f961740b5583499da6693acc35 Optional: md5-12ae6f7e8570d33ae81f58c958448268

Nested Schema for container_definitions.log_configuration.secret_options

Required: md5-54ea632df5976300d833d7d0bcc10d3a

Nested Schema for container_definitions.mount_points

Optional: md5-ea3acd52288078b6de01d105b6fd7dec

Nested Schema for container_definitions.port_mappings

Optional: md5-fda8a2604b618821b888a32ae8aa67db

You can call DescribeTasks to view the hostPortRange which are the host ports that are bound to the container ports.

  • host_port (Number) The port number on the container instance to reserve for your container. If you specify a containerPortRange, leave this field empty and the value of the hostPort is set as follows:

    If you use containers in a task with the awsvpc or host network mode, the hostPort can either be left blank or set to the same value as the containerPort. If you use containers in a task with the bridge network mode, you can specify a non-reserved host port for your container port mapping, or you can omit the hostPort (or set it to 0) while specifying a containerPort and your container automatically receives a port in the ephemeral port range for your container instance operating system and Docker version. The default ephemeral port range for Docker version 1.6.0 and later is listed on the instance under /proc/sys/net/ipv4/ip_local_port_range. If this kernel parameter is unavailable, the default ephemeral port range from 49153 through 65535 (Linux) or 49152 through 65535 (Windows) is used. Do not attempt to specify a host port in the ephemeral port range as these are reserved for automatic assignment. In general, ports below 32768 are outside of the ephemeral port range. The default reserved ports are 22 for SSH, the Docker ports 2375 and 2376, and the Amazon ECS container agent ports 51678-51680. Any host port that was previously specified in a running task is also reserved while the task is running. That is, after a task stops, the host port is released. The current reserved ports are displayed in the remainingResources of DescribeContainerInstances output. A container instance can have up to 100 reserved ports at a time. This number includes the default reserved ports. Automatically assigned ports aren't included in the 100 reserved ports quota.

  • name (String) The name that's used for the port mapping. This parameter only applies to Service Connect. This parameter is the name that you use in the serviceConnectConfiguration of a service. The name can include up to 64 characters. The characters can include lowercase letters, numbers, underscores (_), and hyphens (-). The name can't start with a hyphen. For more information, see Service Connect in the Amazon Elastic Container Service Developer Guide.
  • protocol (String) The protocol used for the port mapping. Valid values are tcp and udp. The default is tcp. protocol is immutable in a Service Connect service. Updating this field requires a service deletion and redeployment.
  • Nested Schema for container_definitions.repository_credentials

    Optional:

    Nested Schema for container_definitions.resource_requirements

    Required:

    Nested Schema for container_definitions.secrets

    Required:

    Nested Schema for container_definitions.system_controls

    Optional:

    Nested Schema for container_definitions.ulimits

    Required:

    Nested Schema for container_definitions.volumes_from

    Optional:

    Nested Schema for ephemeral_storage

    Optional:

    Nested Schema for inference_accelerators

    Optional:

    Nested Schema for placement_constraints

    Required:

    Optional:

    Nested Schema for proxy_configuration

    Required:

    Optional:

    Nested Schema for proxy_configuration.proxy_configuration_properties

    Optional:

    Nested Schema for runtime_platform

    Optional:

    Nested Schema for tags

    Optional:

    Nested Schema for volumes

    Optional:

    Nested Schema for volumes.docker_volume_configuration

    Optional:

    Nested Schema for volumes.efs_volume_configuration

    Required:

    Optional:

    Nested Schema for volumes.efs_volume_configuration.authorization_config

    Optional:

    Nested Schema for volumes.fsx_windows_file_server_volume_configuration

    Required:

    Optional:

    Nested Schema for volumes.fsx_windows_file_server_volume_configuration.authorization_config

    Required:

    Nested Schema for volumes.host

    Optional:

    Import

    Import is supported using the following syntax:

    $ terraform import awscc_ecs_task_definition.example <resource ID>