github.com/nevins-b/terraform@v0.3.8-0.20170215184714-bbae22007d5a/website/source/docs/providers/aws/d/ecs_task_definition.html.markdown (about)

     1  ---
     2  layout: "aws"
     3  page_title: "AWS: aws_ecs_task_definition"
     4  sidebar_current: "docs-aws-datasource-ecs-task-definition"
     5  description: |-
     6      Provides details about an ecs task definition
     7  ---
     8  
     9  # aws\_ecs\_task\_definition
    10  
    11  The ECS task definition data source allows access to details of
    12  a specific AWS ECS task definition.
    13  
    14  
    15  ## Example Usage
    16  
    17  ```
    18  # Simply specify the family to find the latest ACTIVE revision in that family.
    19  data "aws_ecs_task_definition" "mongo" {
    20    task_definition = "${aws_ecs_task_definition.mongo.family}"
    21  }
    22  
    23  resource "aws_ecs_cluster" "foo" {
    24    name = "foo"
    25  }
    26  
    27  resource "aws_ecs_task_definition" "mongo" {
    28    family = "mongodb"
    29    container_definitions = <<DEFINITION
    30  [
    31    {
    32      "cpu": 128,
    33      "environment": [{
    34        "name": "SECRET",
    35        "value": "KEY"
    36      }],
    37      "essential": true,
    38      "image": "mongo:latest",
    39      "memory": 128,
    40      "memoryReservation": 64,
    41      "name": "mongodb"
    42    }
    43  ]
    44  DEFINITION
    45  }
    46  
    47  resource "aws_ecs_service" "mongo" {
    48    name = "mongo"
    49    cluster = "${aws_ecs_cluster.foo.id}"
    50    desired_count = 2
    51  
    52    # Track the latest ACTIVE revision
    53    task_definition = "${aws_ecs_task_definition.mongo.family}:${max("${aws_ecs_task_definition.mongo.revision}", "${data.aws_ecs_task_definition.mongo.revision}")}"
    54  }
    55  ```
    56  
    57  ## Argument Reference
    58  
    59  The following arguments are supported:
    60  
    61  * `task_definition` - (Required) The family for the latest ACTIVE revision, family and revision (family:revision) for a specific revision in the family, the ARN of the task definition to access to.
    62  
    63  ## Attributes Reference
    64  
    65  The following attributes are exported:
    66  
    67  * `family` - The family of this task definition
    68  * `network_mode` - The Docker networking mode to use for the containers in this task.
    69  * `revision` - The revision of this task definition
    70  * `status` - The status of this task definition
    71  * `task_role_arn` - The ARN of the IAM role that containers in this task can assume