terraform-aws-ecs-container-definition

Terraform module to generate well-formed JSON documents (container definitions) that are passed to the aws_ecs_task_definition Terraform resource

APACHE-2.0 License

Stars
339
Committers
52

Bot releases are visible (Hide)

terraform-aws-ecs-container-definition - 0.33.0: Uses appropriate defaults for `user` and `environment`

Published by Gowiem over 4 years ago

what

Use the same defaults of user and environment as the AWS API defaults

why

Noticed on subsequent applies that user goes from 0 to null and environment goes from [] to null

references

https://github.com/cloudposse/terraform-aws-ecs-container-definition/pull/65

terraform-aws-ecs-container-definition - 0.32.0: Fixes not using local.container_definition_without_null when merging

Published by Gowiem over 4 years ago

what

Previous PR https://github.com/cloudposse/terraform-aws-ecs-container-definition/pull/81 forgot to use local.container_definition_without_null when merging

why

  • null is still showing up in the diff

references

terraform-aws-ecs-container-definition - 0.31.0: Extra Parameters

Published by nitrocode over 4 years ago

what

  • Support a new parameter named var.container_definition which is an object.

why

  • This would allow absolutely any parameter to be passed to the module, or to override the behavior of the module on any property
terraform-aws-ecs-container-definition - 0.30.0: Reduce diff spam and unset defaults #65

Published by nitrocode over 4 years ago

what

  • Reduce diff spam and unset defaults

why

  • To reduce noise in the terraform plan
terraform-aws-ecs-container-definition - 0.29.0: Make log_configuration's secretOptions optional #76

Published by nitrocode over 4 years ago

what

  • Make log_configuration's secretOptions optional

why

  • So secretOptions won't need to be set to use the log_configuration
terraform-aws-ecs-container-definition - 0.28.0: Add support for extra_hosts option #62

Published by Gowiem over 4 years ago

what

  • Adds extra_hosts variable

why

  • Adds the ability to add hostnames and IP address mappings to the /etc/hosts file on the container.
terraform-aws-ecs-container-definition -

Published by osterman over 4 years ago

terraform-aws-ecs-container-definition - 0.26.0 Remove default port mapping as it is optional

Published by nitrocode over 4 years ago

what

  • Remove default port mapping as it is optional

why

  • The default port mapping is optional so maintaining a default port 80 mapping didn't make sense.
terraform-aws-ecs-container-definition - 0.25.0 Change variable "privileged" type to bool

Published by aknysh over 4 years ago

what

  • Change variable "privileged" type to bool

why

  • The variable "privileged" is currently type string, which is a holdover from Terraform v0.11/HCL v1. This variable is broken in TF 0.12; it causes an error because the AWS provider was expected a bool true but got a string "true" instead
terraform-aws-ecs-container-definition - 0.24.0 Add `environmentFiles` parameter

Published by aknysh over 4 years ago

what

  • Add the new environmentFiles parameter to the container definition

why

  • AWS announced that ECS supports environment files for the EC2 launch type

references

terraform-aws-ecs-container-definition - 0.23.0 Add support for linuxParameters

Published by aknysh almost 5 years ago

what

  • Add support for linuxParameters

why

  • linuxParameters are Linux-specific modifications that are applied to the container, such as Linux kernel capabilities

references

terraform-aws-ecs-container-definition - 0.22.0 Fix container_depends_on regression

Published by aknysh almost 5 years ago

what

  • Fix container_depends_on regression

why

  • Update type for container_depends_on to support newer capabilities as specified here. The dependsOn attribute is now an array of ContainerDependency objects.
terraform-aws-ecs-container-definition - 0.21.0 Simplify code using TF 0.12 first-class types and syntax. Sort provided ENV vars. Add missing parameters

Published by aknysh almost 5 years ago

what

  • Simplify code using TF 0.12 first-class types and syntax
  • Sort provided ENV vars
  • Add missing parameters

why

  • No need to convert all falsy values into null and un-quote booleans and numbers since TF 0.12 has first class types for bool, number and object that can be converted directly to JSON, as well as null value which is supported in JSON. So this is not needed:
# The following hacks are required to overcome TF automatic type conversions which lead to issues with the resulting json types.
# Conversion happens by using the built-in `replace` function in this order:
#  - Convert `""`, `{}`, `[]`, and `[""]` to `null`
#  - Convert `"true"` and `"false"` to `true` and `false`
#  - Convert quoted numbers (e.g. `"123"`) to `123`.
  • Sort provided ENV vars so terraform will not attempt to recreate on each plan/apply

related

  • Closes #40
  • Closes #20
  • Closes #33
  • Closes #41

test

  • terraform apply on examples/complete produces a valid JSON with sorted ENV vars containing names and values as strings (as required by ECS)
json_map = {"command":null,"cpu":256,"dependsOn":null,"dnsServers":null,"dockerLabels":null,"entryPoint":null,"environment":[{"name":"false_boolean_var","value":"false"},{"name":"integer_var","value":"42"},{"name":"string_var","value":"I am a string"},{"name":"true_boolean_var","value":"true"}],"essential":true,"firelensConfiguration":null,"healthCheck":null,"image":"cloudposse/geodesic","links":null,"logConfiguration":{"logDriver":"json-file","options":{"max-file":"3","max-size":"10m"},"secretOptions":null},"memory":256,"memoryReservation":128,"mountPoints":null,"name":"app","portMappings":[{"containerPort":8080,"hostPort":80,"protocol":"tcp"},{"containerPort":8081,"hostPort":443,"protocol":"udp"}],"privileged":null,"readonlyRootFilesystem":false,"repositoryCredentials":null,"secrets":null,"stopTimeout":30,"systemControls":null,"ulimits":null,"user":null,"volumesFrom":null,"workingDirectory":null}
terraform-aws-ecs-container-definition - 0.20.0 Convert to TF 0.12. Add tests. Add Codefresh test pipeline

Published by aknysh almost 5 years ago

what

  • Port module to Terraform 0.12
  • Pin all providers
  • Add example for testing
  • Add bats and terratest for the example
  • Add Codefresh badge to point to the test pipeline in terraform-modules project
  • Update README

why

  • Module currently does not work with 0.12. Much easier syntax
  • Better regression control
  • Automatically test the example on every commit and pull request
  • Provision resources on AWS in the test account and check the outputs for the correct values
  • terraform-modules project contains pipelines for all terraform modules
terraform-aws-ecs-container-definition - 0.19.0 Add support for systemControls

Published by aknysh almost 5 years ago

what

  • Add support for systemControls

why

  • Supported by ECS container definition
terraform-aws-ecs-container-definition - 0.18.0 Add `firelensConfiguration`

Published by aknysh almost 5 years ago

what

  • Add firelensConfiguration

why

  • To specify and configure a log router for container logs

references

terraform-aws-ecs-container-definition - 0.17.0 Add docker labels

Published by aknysh almost 5 years ago

what

  • Add docker labels

why

  • Add docker labels to the container definition
terraform-aws-ecs-container-definition - 0.16.0 Add privileged parameter

Published by aknysh almost 5 years ago

what

  • Add privileged parameter

why

  • To allow containers to be given elevated privileges on the host container instance. The default value is "" rather than "false" so that it becomes "privileged": null in the JSON output. This is because this parameter is not supported for Windows containers or tasks using the Fargate launch type.
terraform-aws-ecs-container-definition -

Published by goruha over 5 years ago

terraform-aws-ecs-container-definition - 0.14.0 Add support for `stopTimeout` in container definition

Published by aknysh over 5 years ago

what

  • Add support for stopTimeout in container definition

why

  • To specify timeout in seconds between sending SIGTERM and SIGKILL to container