Skip to content

Commit

Permalink
fix: update tests to use latest Terraform version
Browse files Browse the repository at this point in the history
BREAKING CHANGE:

This module no longer supports Terraform versions 0.11.x. Please upgrade
your version of Terraform and run the `0.12upgrade` command. Visit the
following URL for more information:

    https://www.terraform.io/docs/commands/0.12upgrade.html
  • Loading branch information
jasonwalsh committed Mar 19, 2020
1 parent dd333c3 commit 57a01ac
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 22 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand All @@ -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 |

Expand Down
9 changes: 6 additions & 3 deletions examples/ecs_update_service.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
1 change: 0 additions & 1 deletion modules/merge/variables.tf
Original file line number Diff line number Diff line change
@@ -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"
}
15 changes: 7 additions & 8 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand All @@ -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" {
Expand Down Expand Up @@ -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" {
Expand All @@ -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" {
Expand All @@ -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" {
Expand Down Expand Up @@ -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" {
Expand All @@ -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" {
Expand All @@ -248,4 +248,3 @@ variable "workingDirectory" {
default = ""
description = "The working directory in which to run commands inside the container"
}

0 comments on commit 57a01ac

Please sign in to comment.