github.com/jmbataller/terraform@v0.6.8-0.20151125192640-b7a12e3a580c/website/source/docs/providers/aws/r/ecs_task_definition.html.markdown (about)

     1  ---
     2  layout: "aws"
     3  page_title: "AWS: aws_ecs_task_definition"
     4  sidebar_current: "docs-aws-resource-ecs-task-definition"
     5  description: |-
     6    Provides an ECS task definition.
     7  ---
     8  
     9  # aws\_ecs\_task\_definition
    10  
    11  Provides an ECS task definition to be used in `aws_ecs_service`.
    12  
    13  ## Example Usage
    14  
    15  ```
    16  resource "aws_ecs_task_definition" "jenkins" {
    17    family = "jenkins"
    18    container_definitions = "${file("task-definitions/jenkins.json")}"
    19  
    20    volume {
    21      name = "jenkins-home"
    22      host_path = "/ecs/jenkins-home"
    23    }
    24  }
    25  ```
    26  
    27  ### task-definitions/jenkins.json
    28  
    29  The below would be passed into the `container_definitions` attribute. This is a small subset of the available parameters, see the [AWS docs](http://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html) for a full list.
    30  
    31  ```
    32  [
    33    {
    34      "name": "jenkins",
    35      "image": "jenkins",
    36      "cpu": 10,
    37      "memory": 500,
    38      "essential": true,
    39      "portMappings": [
    40        {
    41          "containerPort": 80,
    42          "hostPort": 80
    43        }
    44      ]
    45    }
    46  ]
    47  ```
    48  
    49  ## Argument Reference
    50  
    51  The following arguments are supported:
    52  
    53  * `family` - (Required) The family, unique name for your task definition.
    54  * `container_definitions` - (Required) A list of container definitions in JSON format. See [AWS docs](http://docs.aws.amazon.com/AmazonECS/latest/developerguide/create-task-definition.html) for syntax. Note, you only need the containerDefinitions array, not the parent hash including the family and volumes keys.
    55  * `volume` - (Optional) A volume block. Volumes documented below.
    56  
    57  Volumes support the following:
    58  
    59  * `name` - (Required) The name of the volume. This name is referenced in the `sourceVolume` parameter of container definition `mountPoints`.
    60  * `host_path` - (Required) The path on the host container instance that is presented to the container.
    61  
    62  ## Attributes Reference
    63  
    64  The following attributes are exported:
    65  
    66  * `arn` - Full ARN of the task definition (including both `family` & `revision`)
    67  * `family` - The family of the task definition.
    68  * `revision` - The revision of the task in a particular family.