From 928d5f76ab899f5f1edca2412656d564200bcc65 Mon Sep 17 00:00:00 2001 From: Nathan Sullivan Date: Thu, 2 Jul 2015 20:34:58 +1000 Subject: [PATCH 1/3] updated docs for aws_ecs_task_definition to avoid confusion --- .../aws/r/ecs_task_definition.html.markdown | 26 ++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/website/source/docs/providers/aws/r/ecs_task_definition.html.markdown b/website/source/docs/providers/aws/r/ecs_task_definition.html.markdown index e89a81e1a..1d1578bcf 100644 --- a/website/source/docs/providers/aws/r/ecs_task_definition.html.markdown +++ b/website/source/docs/providers/aws/r/ecs_task_definition.html.markdown @@ -12,6 +12,8 @@ Provides an ECS task definition to be used in `aws_ecs_service`. ## Example Usage +### jenkins.tf + ``` resource "aws_ecs_task_definition" "jenkins" { family = "jenkins" @@ -24,12 +26,34 @@ resource "aws_ecs_task_definition" "jenkins" { } ``` +### task-definitions/jenkins.json + +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. + +``` +[ + { + "name": "jenkins", + "image": "jenkins", + "cpu": 10, + "memory": 500, + "essential": true, + "portMappings": [ + { + "containerPort": 80, + "hostPort": 80 + } + ] + } +] +``` + ## Argument Reference The following arguments are supported: * `family` - (Required) The family, unique name for your task definition. -* `container_definitions` - (Required) A list of container definitions in JSON format. See [AWS docs](http://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_defintions.html) for syntax. +* `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 contents, not the parent hash including the family and volumes keys. * `volume` - (Optional) A volume block. Volumes documented below. Volumes support the following: From 21a336fb4af0c3717c3466dfbd4dd8f00a3966d1 Mon Sep 17 00:00:00 2001 From: Nathan Sullivan Date: Fri, 3 Jul 2015 18:30:55 +1000 Subject: [PATCH 2/3] updates as per @radeksimko's comments --- .../aws/r/ecs_task_definition.html.markdown | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/website/source/docs/providers/aws/r/ecs_task_definition.html.markdown b/website/source/docs/providers/aws/r/ecs_task_definition.html.markdown index 1d1578bcf..ac47f847e 100644 --- a/website/source/docs/providers/aws/r/ecs_task_definition.html.markdown +++ b/website/source/docs/providers/aws/r/ecs_task_definition.html.markdown @@ -12,23 +12,9 @@ Provides an ECS task definition to be used in `aws_ecs_service`. ## Example Usage -### jenkins.tf - -``` -resource "aws_ecs_task_definition" "jenkins" { - family = "jenkins" - container_definitions = "${file("task-definitions/jenkins.json")}" - - volume { - name = "jenkins-home" - host_path = "/ecs/jenkins-home" - } -} -``` - ### task-definitions/jenkins.json -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. +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. ``` [ @@ -53,7 +39,7 @@ This is a small subset of the available parameters, see the [AWS docs](http://do The following arguments are supported: * `family` - (Required) The family, unique name for your task definition. -* `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 contents, not the parent hash including the family and volumes keys. +* `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. * `volume` - (Optional) A volume block. Volumes documented below. Volumes support the following: From bba53d46a659839779b476ee401c0e8c9a9bc9bb Mon Sep 17 00:00:00 2001 From: Nathan Sullivan Date: Sat, 4 Jul 2015 03:41:44 +1000 Subject: [PATCH 3/3] oops :) --- .../aws/r/ecs_task_definition.html.markdown | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/website/source/docs/providers/aws/r/ecs_task_definition.html.markdown b/website/source/docs/providers/aws/r/ecs_task_definition.html.markdown index ac47f847e..3c761aa62 100644 --- a/website/source/docs/providers/aws/r/ecs_task_definition.html.markdown +++ b/website/source/docs/providers/aws/r/ecs_task_definition.html.markdown @@ -12,6 +12,18 @@ Provides an ECS task definition to be used in `aws_ecs_service`. ## Example Usage +``` +resource "aws_ecs_task_definition" "jenkins" { + family = "jenkins" + container_definitions = "${file("task-definitions/jenkins.json")}" + + volume { + name = "jenkins-home" + host_path = "/ecs/jenkins-home" + } +} +``` + ### task-definitions/jenkins.json 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.