diff --git a/README.md b/README.md index cc3355f..bffc4b5 100644 --- a/README.md +++ b/README.md @@ -121,27 +121,27 @@ By default, this module creates a task definition with a single container defini | dockerLabels | A key/value map of labels to add to the container | `map(string)` | `{}` | no | | dockerSecurityOptions | A list of strings to provide custom labels for SELinux and AppArmor multi-level security systems | `list(string)` | `[]` | no | | entryPoint | The entry point that is passed to the container | `list(string)` | `[]` | no | -| environment | The environment variables to pass to a container | `list(string)` | `[]` | no | +| environment | The environment variables to pass to a container | `list(map(string))` | `[]` | no | | essential | If the essential parameter of a container is marked as true, and that container fails or stops for any reason, all other containers that are part of the task are stopped | `bool` | `true` | no | | execution\_role\_arn | The Amazon Resource Name (ARN) of the task execution role that the Amazon ECS container agent and the Docker daemon can assume | `string` | `""` | no | | extraHosts | A list of hostnames and IP address mappings to append to the /etc/hosts file on the container | `list(string)` | `[]` | no | | family | You must specify a family for a task definition, which allows you to track multiple versions of the same task definition | `any` | n/a | yes | -| healthCheck | The health check command and associated configuration parameters for the container | `map(string)` | `{}` | no | +| healthCheck | The health check command and associated configuration parameters for the container | `any` | `{}` | no | | hostname | The hostname to use for your container | `string` | `""` | no | | image | The image used to start a container | `string` | `""` | no | | interactive | When this parameter is true, this allows you to deploy containerized applications that require stdin or a tty to be allocated | `bool` | `false` | no | | ipc\_mode | The IPC resource namespace to use for the containers in the task | `string` | `"host"` | no | | links | The link parameter allows containers to communicate with each other without the need for port mappings | `list(string)` | `[]` | no | -| linuxParameters | Linux-specific modifications that are applied to the container, such as Linux KernelCapabilities | `map(string)` | `{}` | no | +| linuxParameters | Linux-specific modifications that are applied to the container, such as Linux KernelCapabilities | `any` | `{}` | no | | logConfiguration | The log configuration specification for the container | `map(string)` | `{}` | no | | memory | The hard limit (in MiB) of memory to present to the container | `number` | `0` | no | | memoryReservation | The soft limit (in MiB) of memory to reserve for the container | `number` | `0` | no | -| mountPoints | The mount points for data volumes in your container | `list(string)` | `[]` | no | +| mountPoints | The mount points for data volumes in your container | `list(any)` | `[]` | no | | name | The name of a container | `string` | `""` | no | | network\_mode | The Docker networking mode to use for the containers in the task | `string` | `"bridge"` | no | | pid\_mode | The process namespace to use for the containers in the task | `string` | `"host"` | no | | placement\_constraints | An array of placement constraint objects to use for the task | `list(string)` | `[]` | no | -| portMappings | The list of port mappings for the container | `list(string)` | `[]` | no | +| portMappings | The list of port mappings for the container | `list(any)` | `[]` | no | | privileged | When this parameter is true, the container is given elevated privileges on the host container instance (similar to the root user) | `bool` | `false` | no | | pseudoTerminal | When this parameter is true, a TTY is allocated | `bool` | `false` | no | | readonlyRootFilesystem | When this parameter is true, the container is given read-only access to its root file system | `bool` | `false` | no | @@ -153,9 +153,9 @@ By default, this module creates a task definition with a single container defini | systemControls | A list of namespaced kernel parameters to set in the container | `list(string)` | `[]` | no | | tags | The metadata that you apply to the task definition to help you categorize and organize them | `map(string)` | `{}` | no | | task\_role\_arn | The short name or full Amazon Resource Name (ARN) of the IAM role that containers in this task can assume | `string` | `""` | no | -| ulimits | A list of ulimits to set in the container | `list(string)` | `[]` | no | +| ulimits | A list of ulimits to set in the container | `list(any)` | `[]` | no | | user | The user name to use inside the container | `string` | `""` | no | -| volumes | A list of volume definitions in JSON format that containers in your task may use | `list(string)` | `[]` | no | +| volumes | A list of volume definitions in JSON format that containers in your task may use | `list(any)` | `[]` | no | | volumesFrom | Data volumes to mount from another container | `list(string)` | `[]` | no | | workingDirectory | The working directory in which to run commands inside the container | `string` | `""` | no | diff --git a/examples/ecs_update_service.tf b/examples/ecs_update_service.tf index 039fb60..46d7f19 100644 --- a/examples/ecs_update_service.tf +++ b/examples/ecs_update_service.tf @@ -8,7 +8,10 @@ # # $ terraform taint null_resource.update-service -provider "aws" {} +provider "aws" { + region = "us-east-1" + version = "~> 2.0" +} module "mongo-task-definition" { source = "github.com/mongodb/terraform-aws-ecs-task-definition" @@ -28,12 +31,12 @@ module "mongo-task-definition" { resource "aws_ecs_service" "mongo" { cluster = "mongo" name = "mongo" - task_definition = "${module.mongo-task-definition.arn}" + task_definition = module.mongo-task-definition.arn } resource "null_resource" "update-service" { triggers = { - arn = "${module.mongo-task-definition.arn}" + arn = module.mongo-task-definition.arn } provisioner "local-exec" { diff --git a/examples/terraform-task-definition-multiple-containers/main.tf b/examples/terraform-task-definition-multiple-containers/main.tf index ba5bf94..a7a4715 100644 --- a/examples/terraform-task-definition-multiple-containers/main.tf +++ b/examples/terraform-task-definition-multiple-containers/main.tf @@ -38,12 +38,12 @@ module "merged" { source = "../../modules/merge" container_definitions = [ - "${module.mongodb.container_definitions}", - "${module.redis.container_definitions}", + module.mongodb.container_definitions, + module.redis.container_definitions, ] } resource "aws_ecs_task_definition" "ecs_task_definition" { - container_definitions = "${module.merged.container_definitions}" + container_definitions = module.merged.container_definitions family = "app" } diff --git a/modules/merge/variables.tf b/modules/merge/variables.tf index f66e9ca..5a8959b 100644 --- a/modules/merge/variables.tf +++ b/modules/merge/variables.tf @@ -1,5 +1,4 @@ variable "container_definitions" { default = [] description = "A list of container definitions in JSON format that describe the different containers that make up your task" - type = "list" } diff --git a/variables.tf b/variables.tf index 764d2bb..0020b5c 100644 --- a/variables.tf +++ b/variables.tf @@ -50,7 +50,7 @@ variable "entryPoint" { variable "environment" { default = [] description = "The environment variables to pass to a container" - type = list(string) + type = list(map(string)) } variable "essential" { @@ -76,7 +76,7 @@ variable "family" { variable "healthCheck" { default = {} description = "The health check command and associated configuration parameters for the container" - type = map(string) + type = any } variable "hostname" { @@ -108,7 +108,7 @@ variable "links" { variable "linuxParameters" { default = {} description = "Linux-specific modifications that are applied to the container, such as Linux KernelCapabilities" - type = map(string) + type = any } variable "logConfiguration" { @@ -130,7 +130,7 @@ variable "memoryReservation" { variable "mountPoints" { default = [] description = "The mount points for data volumes in your container" - type = list(string) + type = list(any) } variable "name" { @@ -157,7 +157,7 @@ variable "placement_constraints" { variable "portMappings" { default = [] description = "The list of port mappings for the container" - type = list(string) + type = list(any) } variable "privileged" { @@ -224,7 +224,7 @@ variable "task_role_arn" { variable "ulimits" { default = [] description = "A list of ulimits to set in the container" - type = list(string) + type = list(any) } variable "user" { @@ -235,7 +235,7 @@ variable "user" { variable "volumes" { default = [] description = "A list of volume definitions in JSON format that containers in your task may use" - type = list(string) + type = list(any) } variable "volumesFrom" { @@ -248,4 +248,3 @@ variable "workingDirectory" { default = "" description = "The working directory in which to run commands inside the container" } -