{"id":14957860,"url":"https://github.com/cloudposse/terraform-aws-ecs-container-definition","last_synced_at":"2025-05-15T10:05:24.637Z","repository":{"id":34759190,"uuid":"135675747","full_name":"cloudposse/terraform-aws-ecs-container-definition","owner":"cloudposse","description":"Terraform module to generate well-formed JSON documents (container definitions) that are passed to the  aws_ecs_task_definition Terraform resource","archived":false,"fork":false,"pushed_at":"2025-02-28T19:20:29.000Z","size":4260,"stargazers_count":345,"open_issues_count":6,"forks_count":243,"subscribers_count":25,"default_branch":"main","last_synced_at":"2025-04-14T16:56:04.375Z","etag":null,"topics":["aws","container-definition","docker","ecs","fargate","hcl2","task","terraform","terraform-module"],"latest_commit_sha":null,"homepage":"https://cloudposse.com/accelerate","language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cloudposse.png","metadata":{"funding":{"github":"cloudposse"},"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-06-01T06:17:49.000Z","updated_at":"2025-04-09T07:38:04.000Z","dependencies_parsed_at":"2023-01-15T09:00:25.174Z","dependency_job_id":"851ca0ba-0e5f-4017-aba0-fa3b086477e5","html_url":"https://github.com/cloudposse/terraform-aws-ecs-container-definition","commit_stats":{"total_commits":103,"total_committers":53,"mean_commits":"1.9433962264150944","dds":0.854368932038835,"last_synced_commit":"e012f93a9c3d2f3fc20e332823abc022a9cfddbd"},"previous_names":[],"tags_count":83,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudposse%2Fterraform-aws-ecs-container-definition","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudposse%2Fterraform-aws-ecs-container-definition/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudposse%2Fterraform-aws-ecs-container-definition/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudposse%2Fterraform-aws-ecs-container-definition/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cloudposse","download_url":"https://codeload.github.com/cloudposse/terraform-aws-ecs-container-definition/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254319718,"owners_count":22051072,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","container-definition","docker","ecs","fargate","hcl2","task","terraform","terraform-module"],"created_at":"2024-09-24T13:15:43.670Z","updated_at":"2025-05-15T10:05:24.325Z","avatar_url":"https://github.com/cloudposse.png","language":"HCL","funding_links":["https://github.com/sponsors/cloudposse"],"categories":["terraform"],"sub_categories":[],"readme":"\n\n\u003c!-- markdownlint-disable --\u003e\n\u003ca href=\"https://cpco.io/homepage\"\u003e\u003cimg src=\"https://github.com/cloudposse/terraform-aws-ecs-container-definition/blob/main/.github/banner.png?raw=true\" alt=\"Project Banner\"/\u003e\u003c/a\u003e\u003cbr/\u003e\n    \u003cp align=\"right\"\u003e\n\u003ca href=\"https://github.com/cloudposse/terraform-aws-ecs-container-definition/releases/latest\"\u003e\u003cimg src=\"https://img.shields.io/github/release/cloudposse/terraform-aws-ecs-container-definition.svg?style=for-the-badge\" alt=\"Latest Release\"/\u003e\u003c/a\u003e\u003ca href=\"https://github.com/cloudposse/terraform-aws-ecs-container-definition/commits\"\u003e\u003cimg src=\"https://img.shields.io/github/last-commit/cloudposse/terraform-aws-ecs-container-definition.svg?style=for-the-badge\" alt=\"Last Updated\"/\u003e\u003c/a\u003e\u003ca href=\"https://slack.cloudposse.com\"\u003e\u003cimg src=\"https://slack.cloudposse.com/for-the-badge.svg\" alt=\"Slack Community\"/\u003e\u003c/a\u003e\u003c/p\u003e\n\u003c!-- markdownlint-restore --\u003e\n\n\u003c!--\n\n\n\n\n  ** DO NOT EDIT THIS FILE\n  **\n  ** This file was automatically generated by the `cloudposse/build-harness`.\n  ** 1) Make all changes to `README.yaml`\n  ** 2) Run `make init` (you only need to do this once)\n  ** 3) Run`make readme` to rebuild this file.\n  **\n  ** (We maintain HUNDREDS of open source projects. This is how we maintain our sanity.)\n  **\n\n\n\n\n\n--\u003e\n\nTerraform module to generate well-formed JSON documents that are passed to the `aws_ecs_task_definition` Terraform resource as [container definitions](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html#container_definitions).\n\n\n\u003e [!TIP]\n\u003e #### 👽 Use Atmos with Terraform\n\u003e Cloud Posse uses [`atmos`](https://atmos.tools) to easily orchestrate multiple environments using Terraform. \u003cbr/\u003e\n\u003e Works with [Github Actions](https://atmos.tools/integrations/github-actions/), [Atlantis](https://atmos.tools/integrations/atlantis), or [Spacelift](https://atmos.tools/integrations/spacelift).\n\u003e\n\u003e \u003cdetails\u003e\n\u003e \u003csummary\u003e\u003cstrong\u003eWatch demo of using Atmos with Terraform\u003c/strong\u003e\u003c/summary\u003e\n\u003e \u003cimg src=\"https://github.com/cloudposse/atmos/blob/main/docs/demo.gif?raw=true\"/\u003e\u003cbr/\u003e\n\u003e \u003ci\u003eExample of running \u003ca href=\"https://atmos.tools\"\u003e\u003ccode\u003eatmos\u003c/code\u003e\u003c/a\u003e to manage infrastructure from our \u003ca href=\"https://atmos.tools/quick-start/\"\u003eQuick Start\u003c/a\u003e tutorial.\u003c/i\u003e\n\u003e \u003c/detalis\u003e\n\n\n\n\n\n## Usage\n\nThis module is meant to be used as output only, meaning it will be used to create outputs which are consumed as a parameter by Terraform resources or other modules.\n\nCaution: This module, unlike nearly all other Cloud Posse Terraform modules, does not use [terraform-null-label](https://github.com/cloudposse/terraform-null-label/).\nFurthermore, it has an input named `environment` which has a completely different meaning than the one in `terraform-null-label`.\nDo not call this module with the conventional `context = module.this.context`. See the documentation below for the usage of `environment`.\n\nFor complete examples, see\n\n- [multi-port mappings](examples/multi_port_mappings)\n- [multi-type env vars](examples/multi_type_env_vars)\n- [multiple definitions](examples/multiple_definitions)\n- [string env vars](examples/string_env_vars)\n\nFor a complete example with automated tests, see [examples/complete](examples/complete) with `bats` and `Terratest` for the example [test](test).\n\n```hcl\nmodule \"container_definition\" {\n  source = \"cloudposse/ecs-container-definition/aws\"\n  # Cloud Posse recommends pinning every module to a specific version\n  # version = \"x.x.x\"\n\n  container_name  = \"geodesic\"\n  container_image = \"cloudposse/geodesic\"\n}\n```\n\nThe output of this module can then be used with one of our other modules.\n\n```hcl\nmodule \"ecs_alb_service_task\" {\n  source = \"cloudposse/ecs-alb-service-task/aws\"\n  # Cloud Posse recommends pinning every module to a specific version\n  # version = \"x.x.x\"\n\n  # ...\n  container_definition_json = module.container_definition.json_map_encoded_list\n  # ...\n}\n```\n\n\u003e [!IMPORTANT]\n\u003e In Cloud Posse's examples, we avoid pinning modules to specific versions to prevent discrepancies between the documentation\n\u003e and the latest released versions. However, for your own projects, we strongly advise pinning each module to the exact version\n\u003e you're using. This practice ensures the stability of your infrastructure. Additionally, we recommend implementing a systematic\n\u003e approach for updating versions to avoid unexpected changes.\n\n\n\n\n\n\n\n\n\u003c!-- markdownlint-disable --\u003e\n## Makefile Targets\n```text\nAvailable targets:\n\n  help                                Help screen\n  help/all                            Display help for all targets\n  help/short                          This help short screen\n  lint                                Lint terraform code\n\n```\n\u003c!-- markdownlint-restore --\u003e\n\u003c!-- markdownlint-disable --\u003e\n## Requirements\n\n| Name | Version |\n|------|---------|\n| \u003ca name=\"requirement_terraform\"\u003e\u003c/a\u003e [terraform](#requirement\\_terraform) | \u003e= 1.3.0 |\n| \u003ca name=\"requirement_local\"\u003e\u003c/a\u003e [local](#requirement\\_local) | \u003e= 1.2 |\n\n## Providers\n\nNo providers.\n\n## Modules\n\nNo modules.\n\n## Resources\n\nNo resources.\n\n## Inputs\n\n| Name | Description | Type | Default | Required |\n|------|-------------|------|---------|:--------:|\n| \u003ca name=\"input_command\"\u003e\u003c/a\u003e [command](#input\\_command) | The command that is passed to the container | `list(string)` | `null` | no |\n| \u003ca name=\"input_container_cpu\"\u003e\u003c/a\u003e [container\\_cpu](#input\\_container\\_cpu) | The number of cpu units to reserve for the container. This is optional for tasks using Fargate launch type and the total amount of container\\_cpu of all containers in a task will need to be lower than the task-level cpu value | `number` | `0` | no |\n| \u003ca name=\"input_container_definition\"\u003e\u003c/a\u003e [container\\_definition](#input\\_container\\_definition) | Container definition overrides which allows for extra keys or overriding existing keys. | \u003cpre\u003eobject({\u003cbr/\u003e    command = optional(list(string))\u003cbr/\u003e    cpu     = optional(number)\u003cbr/\u003e    dependsOn = optional(list(object({\u003cbr/\u003e      condition     = string\u003cbr/\u003e      containerName = string\u003cbr/\u003e    })))\u003cbr/\u003e    disableNetworking     = optional(bool)\u003cbr/\u003e    dnsSearchDomains      = optional(list(string))\u003cbr/\u003e    dnsServers            = optional(list(string))\u003cbr/\u003e    dockerLabels          = optional(map(string))\u003cbr/\u003e    dockerSecurityOptions = optional(list(string))\u003cbr/\u003e    entryPoint            = optional(list(string))\u003cbr/\u003e    environment = optional(list(object({\u003cbr/\u003e      name  = string\u003cbr/\u003e      value = string\u003cbr/\u003e    })))\u003cbr/\u003e    environmentFiles = optional(list(object({\u003cbr/\u003e      type  = string\u003cbr/\u003e      value = string\u003cbr/\u003e    })))\u003cbr/\u003e    essential = optional(bool)\u003cbr/\u003e    extraHosts = optional(list(object({\u003cbr/\u003e      hostname  = string\u003cbr/\u003e      ipAddress = string\u003cbr/\u003e    })))\u003cbr/\u003e    firelensConfiguration = optional(object({\u003cbr/\u003e      options = optional(map(string))\u003cbr/\u003e      type    = string\u003cbr/\u003e    }))\u003cbr/\u003e    healthCheck = optional(object({\u003cbr/\u003e      command     = list(string)\u003cbr/\u003e      interval    = optional(number)\u003cbr/\u003e      retries     = optional(number)\u003cbr/\u003e      startPeriod = optional(number)\u003cbr/\u003e      timeout     = optional(number)\u003cbr/\u003e    }))\u003cbr/\u003e    hostname    = optional(string)\u003cbr/\u003e    image       = optional(string)\u003cbr/\u003e    interactive = optional(bool)\u003cbr/\u003e    links       = optional(list(string))\u003cbr/\u003e    linuxParameters = optional(object({\u003cbr/\u003e      capabilities = optional(object({\u003cbr/\u003e        add  = optional(list(string))\u003cbr/\u003e        drop = optional(list(string))\u003cbr/\u003e      }))\u003cbr/\u003e      devices = optional(list(object({\u003cbr/\u003e        containerPath = string\u003cbr/\u003e        hostPath      = string\u003cbr/\u003e        permissions   = optional(list(string))\u003cbr/\u003e      })))\u003cbr/\u003e      initProcessEnabled = optional(bool)\u003cbr/\u003e      maxSwap            = optional(number)\u003cbr/\u003e      sharedMemorySize   = optional(number)\u003cbr/\u003e      swappiness         = optional(number)\u003cbr/\u003e      tmpfs = optional(list(object({\u003cbr/\u003e        containerPath = string\u003cbr/\u003e        mountOptions  = optional(list(string))\u003cbr/\u003e        size          = number\u003cbr/\u003e      })))\u003cbr/\u003e    }))\u003cbr/\u003e    logConfiguration = optional(object({\u003cbr/\u003e      logDriver = string\u003cbr/\u003e      options   = optional(map(string))\u003cbr/\u003e      secretOptions = optional(list(object({\u003cbr/\u003e        name      = string\u003cbr/\u003e        valueFrom = string\u003cbr/\u003e      })))\u003cbr/\u003e    }))\u003cbr/\u003e    memory            = optional(number)\u003cbr/\u003e    memoryReservation = optional(number)\u003cbr/\u003e    mountPoints = optional(list(object({\u003cbr/\u003e      containerPath = optional(string)\u003cbr/\u003e      readOnly      = optional(bool)\u003cbr/\u003e      sourceVolume  = optional(string)\u003cbr/\u003e    })))\u003cbr/\u003e    name = optional(string)\u003cbr/\u003e    portMappings = optional(list(object({\u003cbr/\u003e      containerPort = number\u003cbr/\u003e      hostPort      = optional(number)\u003cbr/\u003e      protocol      = optional(string)\u003cbr/\u003e      name          = optional(string)\u003cbr/\u003e      appProtocol   = optional(string)\u003cbr/\u003e    })))\u003cbr/\u003e    privileged             = optional(bool)\u003cbr/\u003e    pseudoTerminal         = optional(bool)\u003cbr/\u003e    readonlyRootFilesystem = optional(bool)\u003cbr/\u003e    repositoryCredentials = optional(object({\u003cbr/\u003e      credentialsParameter = string\u003cbr/\u003e    }))\u003cbr/\u003e    resourceRequirements = optional(list(object({\u003cbr/\u003e      type  = string\u003cbr/\u003e      value = string\u003cbr/\u003e    })))\u003cbr/\u003e    restartPolicy = optional(object({\u003cbr/\u003e      enabled              = bool\u003cbr/\u003e      ignoredExitCodes     = optional(list(number))\u003cbr/\u003e      restartAttemptPeriod = optional(number)\u003cbr/\u003e    }))\u003cbr/\u003e    secrets = optional(list(object({\u003cbr/\u003e      name      = string\u003cbr/\u003e      valueFrom = string\u003cbr/\u003e    })))\u003cbr/\u003e    startTimeout = optional(number)\u003cbr/\u003e    stopTimeout  = optional(number)\u003cbr/\u003e    systemControls = optional(list(object({\u003cbr/\u003e      namespace = string\u003cbr/\u003e      value     = string\u003cbr/\u003e    })))\u003cbr/\u003e    ulimits = optional(list(object({\u003cbr/\u003e      hardLimit = number\u003cbr/\u003e      name      = string\u003cbr/\u003e      softLimit = number\u003cbr/\u003e    })))\u003cbr/\u003e    user               = optional(string)\u003cbr/\u003e    versionConsistency = optional(string)\u003cbr/\u003e    volumesFrom = optional(list(object({\u003cbr/\u003e      readOnly        = optional(bool)\u003cbr/\u003e      sourceContainer = string\u003cbr/\u003e    })))\u003cbr/\u003e    workingDirectory = optional(string)\u003cbr/\u003e  })\u003c/pre\u003e | `{}` | no |\n| \u003ca name=\"input_container_depends_on\"\u003e\u003c/a\u003e [container\\_depends\\_on](#input\\_container\\_depends\\_on) | The dependencies defined for container startup and shutdown. A container can contain multiple dependencies. When a dependency is defined for container startup, for container shutdown it is reversed. The condition can be one of START, COMPLETE, SUCCESS or HEALTHY | \u003cpre\u003elist(object({\u003cbr/\u003e    condition     = string\u003cbr/\u003e    containerName = string\u003cbr/\u003e  }))\u003c/pre\u003e | `null` | no |\n| \u003ca name=\"input_container_image\"\u003e\u003c/a\u003e [container\\_image](#input\\_container\\_image) | The image used to start the container. Images in the Docker Hub registry available by default | `string` | n/a | yes |\n| \u003ca name=\"input_container_memory\"\u003e\u003c/a\u003e [container\\_memory](#input\\_container\\_memory) | The amount of memory (in MiB) to allow the container to use. This is a hard limit, if the container attempts to exceed the container\\_memory, the container is killed. This field is optional for Fargate launch type and the total amount of container\\_memory of all containers in a task will need to be lower than the task memory value | `number` | `null` | no |\n| \u003ca name=\"input_container_memory_reservation\"\u003e\u003c/a\u003e [container\\_memory\\_reservation](#input\\_container\\_memory\\_reservation) | The amount of memory (in MiB) to reserve for the container. If container needs to exceed this threshold, it can do so up to the set container\\_memory hard limit | `number` | `null` | no |\n| \u003ca name=\"input_container_name\"\u003e\u003c/a\u003e [container\\_name](#input\\_container\\_name) | The name of the container. Up to 255 characters ([a-z], [A-Z], [0-9], -, \\_ allowed) | `string` | n/a | yes |\n| \u003ca name=\"input_disable_networking\"\u003e\u003c/a\u003e [disable\\_networking](#input\\_disable\\_networking) | When this parameter is true, networking is disabled within the container. | `bool` | `null` | no |\n| \u003ca name=\"input_dns_search_domains\"\u003e\u003c/a\u003e [dns\\_search\\_domains](#input\\_dns\\_search\\_domains) | Container DNS search domains. A list of DNS search domains that are presented to the container | `list(string)` | `null` | no |\n| \u003ca name=\"input_dns_servers\"\u003e\u003c/a\u003e [dns\\_servers](#input\\_dns\\_servers) | Container DNS servers. This is a list of strings specifying the IP addresses of the DNS servers | `list(string)` | `null` | no |\n| \u003ca name=\"input_docker_labels\"\u003e\u003c/a\u003e [docker\\_labels](#input\\_docker\\_labels) | The configuration options to send to the `docker_labels` | `map(string)` | `null` | no |\n| \u003ca name=\"input_docker_security_options\"\u003e\u003c/a\u003e [docker\\_security\\_options](#input\\_docker\\_security\\_options) | A list of strings to provide custom labels for SELinux and AppArmor multi-level security systems. | `list(string)` | `null` | no |\n| \u003ca name=\"input_entrypoint\"\u003e\u003c/a\u003e [entrypoint](#input\\_entrypoint) | The entry point that is passed to the container | `list(string)` | `null` | no |\n| \u003ca name=\"input_environment\"\u003e\u003c/a\u003e [environment](#input\\_environment) | The environment variables to pass to the container. This is a list of maps. map\\_environment overrides environment | \u003cpre\u003elist(object({\u003cbr/\u003e    name  = string\u003cbr/\u003e    value = string\u003cbr/\u003e  }))\u003c/pre\u003e | `null` | no |\n| \u003ca name=\"input_environment_files\"\u003e\u003c/a\u003e [environment\\_files](#input\\_environment\\_files) | One or more files containing the environment variables to pass to the container. This maps to the --env-file option to docker run. The file must be hosted in Amazon S3. This option is only available to tasks using the EC2 launch type. This is a list of maps | \u003cpre\u003elist(object({\u003cbr/\u003e    type  = string\u003cbr/\u003e    value = string\u003cbr/\u003e  }))\u003c/pre\u003e | `null` | no |\n| \u003ca name=\"input_essential\"\u003e\u003c/a\u003e [essential](#input\\_essential) | Determines whether all other containers in a task are stopped, if this container fails or stops for any reason. Due to how Terraform type casts booleans in json it is required to double quote this value | `bool` | `true` | no |\n| \u003ca name=\"input_extra_hosts\"\u003e\u003c/a\u003e [extra\\_hosts](#input\\_extra\\_hosts) | A list of hostnames and IP address mappings to append to the /etc/hosts file on the container. This is a list of maps | \u003cpre\u003elist(object({\u003cbr/\u003e    hostname  = string\u003cbr/\u003e    ipAddress = string\u003cbr/\u003e  }))\u003c/pre\u003e | `null` | no |\n| \u003ca name=\"input_firelens_configuration\"\u003e\u003c/a\u003e [firelens\\_configuration](#input\\_firelens\\_configuration) | The FireLens configuration for the container. This is used to specify and configure a log router for container logs. For more details, see https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_FirelensConfiguration.html | \u003cpre\u003eobject({\u003cbr/\u003e    options = optional(map(string))\u003cbr/\u003e    type    = string\u003cbr/\u003e  })\u003c/pre\u003e | `null` | no |\n| \u003ca name=\"input_healthcheck\"\u003e\u003c/a\u003e [healthcheck](#input\\_healthcheck) | A map containing command (string), timeout, interval (duration in seconds), retries (1-10, number of times to retry before marking container unhealthy), and startPeriod (0-300, optional grace period to wait, in seconds, before failed healthchecks count toward retries) | \u003cpre\u003eobject({\u003cbr/\u003e    command     = list(string)\u003cbr/\u003e    interval    = optional(number)\u003cbr/\u003e    retries     = optional(number)\u003cbr/\u003e    startPeriod = optional(number)\u003cbr/\u003e    timeout     = optional(number)\u003cbr/\u003e  })\u003c/pre\u003e | `null` | no |\n| \u003ca name=\"input_hostname\"\u003e\u003c/a\u003e [hostname](#input\\_hostname) | The hostname to use for your container. | `string` | `null` | no |\n| \u003ca name=\"input_interactive\"\u003e\u003c/a\u003e [interactive](#input\\_interactive) | When this parameter is true, this allows you to deploy containerized applications that require stdin or a tty to be allocated. | `bool` | `null` | no |\n| \u003ca name=\"input_links\"\u003e\u003c/a\u003e [links](#input\\_links) | List of container names this container can communicate with without port mappings | `list(string)` | `null` | no |\n| \u003ca name=\"input_linux_parameters\"\u003e\u003c/a\u003e [linux\\_parameters](#input\\_linux\\_parameters) | Linux-specific modifications that are applied to the container, such as Linux kernel capabilities. For more details, see https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_LinuxParameters.html | \u003cpre\u003eobject({\u003cbr/\u003e    capabilities = optional(object({\u003cbr/\u003e      add  = optional(list(string))\u003cbr/\u003e      drop = optional(list(string))\u003cbr/\u003e    }))\u003cbr/\u003e    devices = optional(list(object({\u003cbr/\u003e      containerPath = string\u003cbr/\u003e      hostPath      = string\u003cbr/\u003e      permissions   = optional(list(string))\u003cbr/\u003e    })))\u003cbr/\u003e    initProcessEnabled = optional(bool)\u003cbr/\u003e    maxSwap            = optional(number)\u003cbr/\u003e    sharedMemorySize   = optional(number)\u003cbr/\u003e    swappiness         = optional(number)\u003cbr/\u003e    tmpfs = optional(list(object({\u003cbr/\u003e      containerPath = string\u003cbr/\u003e      mountOptions  = optional(list(string))\u003cbr/\u003e      size          = number\u003cbr/\u003e    })))\u003cbr/\u003e  })\u003c/pre\u003e | `null` | no |\n| \u003ca name=\"input_log_configuration\"\u003e\u003c/a\u003e [log\\_configuration](#input\\_log\\_configuration) | Log configuration options to send to a custom log driver for the container. For more details, see https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_LogConfiguration.html | \u003cpre\u003eobject({\u003cbr/\u003e    logDriver = string\u003cbr/\u003e    options   = optional(map(string))\u003cbr/\u003e    secretOptions = optional(list(object({\u003cbr/\u003e      name      = string\u003cbr/\u003e      valueFrom = string\u003cbr/\u003e    })))\u003cbr/\u003e  })\u003c/pre\u003e | `null` | no |\n| \u003ca name=\"input_map_environment\"\u003e\u003c/a\u003e [map\\_environment](#input\\_map\\_environment) | The environment variables to pass to the container. This is a map of string: {key: value}. map\\_environment overrides environment | `map(string)` | `null` | no |\n| \u003ca name=\"input_map_secrets\"\u003e\u003c/a\u003e [map\\_secrets](#input\\_map\\_secrets) | The secrets variables to pass to the container. This is a map of string: {key: value}. map\\_secrets overrides secrets | `map(string)` | `null` | no |\n| \u003ca name=\"input_mount_points\"\u003e\u003c/a\u003e [mount\\_points](#input\\_mount\\_points) | Container mount points. This is a list of maps, where each map should contain `containerPath`, `sourceVolume` and `readOnly` | \u003cpre\u003elist(object({\u003cbr/\u003e    containerPath = optional(string)\u003cbr/\u003e    readOnly      = optional(bool)\u003cbr/\u003e    sourceVolume  = optional(string)\u003cbr/\u003e  }))\u003c/pre\u003e | `null` | no |\n| \u003ca name=\"input_port_mappings\"\u003e\u003c/a\u003e [port\\_mappings](#input\\_port\\_mappings) | The port mappings to configure for the container. This is a list of maps. Each map should contain \"containerPort\", \"hostPort\", and \"protocol\", where \"protocol\" is one of \"tcp\" or \"udp\". If using containers in a task with the awsvpc or host network mode, the hostPort can either be left blank or set to the same value as the containerPort | \u003cpre\u003elist(object({\u003cbr/\u003e    containerPort = number\u003cbr/\u003e    hostPort      = optional(number)\u003cbr/\u003e    protocol      = optional(string)\u003cbr/\u003e    name          = optional(string)\u003cbr/\u003e    appProtocol   = optional(string)\u003cbr/\u003e  }))\u003c/pre\u003e | `null` | no |\n| \u003ca name=\"input_privileged\"\u003e\u003c/a\u003e [privileged](#input\\_privileged) | When this variable is `true`, the container is given elevated privileges on the host container instance (similar to the root user). This parameter is not supported for Windows containers or tasks using the Fargate launch type. | `bool` | `null` | no |\n| \u003ca name=\"input_pseudo_terminal\"\u003e\u003c/a\u003e [pseudo\\_terminal](#input\\_pseudo\\_terminal) | When this parameter is true, a TTY is allocated. | `bool` | `null` | no |\n| \u003ca name=\"input_readonly_root_filesystem\"\u003e\u003c/a\u003e [readonly\\_root\\_filesystem](#input\\_readonly\\_root\\_filesystem) | Determines whether a container is given read-only access to its root filesystem. Due to how Terraform type casts booleans in json it is required to double quote this value | `bool` | `false` | no |\n| \u003ca name=\"input_repository_credentials\"\u003e\u003c/a\u003e [repository\\_credentials](#input\\_repository\\_credentials) | Container repository credentials; required when using a private repo.  This map currently supports a single key; \"credentialsParameter\", which should be the ARN of a Secrets Manager's secret holding the credentials | \u003cpre\u003eobject({\u003cbr/\u003e    credentialsParameter = string\u003cbr/\u003e  })\u003c/pre\u003e | `null` | no |\n| \u003ca name=\"input_resource_requirements\"\u003e\u003c/a\u003e [resource\\_requirements](#input\\_resource\\_requirements) | The type and amount of a resource to assign to a container. The only supported resource is a GPU. | \u003cpre\u003elist(object({\u003cbr/\u003e    type  = string\u003cbr/\u003e    value = string\u003cbr/\u003e  }))\u003c/pre\u003e | `null` | no |\n| \u003ca name=\"input_restart_policy\"\u003e\u003c/a\u003e [restart\\_policy](#input\\_restart\\_policy) | The restart policy for a container. When you set up a restart policy, Amazon ECS can restart the container without needing to replace the task. | \u003cpre\u003eobject({\u003cbr/\u003e    enabled              = bool\u003cbr/\u003e    ignoredExitCodes     = optional(list(number))\u003cbr/\u003e    restartAttemptPeriod = optional(number)\u003cbr/\u003e  })\u003c/pre\u003e | `null` | no |\n| \u003ca name=\"input_secrets\"\u003e\u003c/a\u003e [secrets](#input\\_secrets) | The secrets to pass to the container. This is a list of maps | \u003cpre\u003elist(object({\u003cbr/\u003e    name      = string\u003cbr/\u003e    valueFrom = string\u003cbr/\u003e  }))\u003c/pre\u003e | `null` | no |\n| \u003ca name=\"input_start_timeout\"\u003e\u003c/a\u003e [start\\_timeout](#input\\_start\\_timeout) | Time duration (in seconds) to wait before giving up on resolving dependencies for a container | `number` | `null` | no |\n| \u003ca name=\"input_stop_timeout\"\u003e\u003c/a\u003e [stop\\_timeout](#input\\_stop\\_timeout) | Time duration (in seconds) to wait before the container is forcefully killed if it doesn't exit normally on its own | `number` | `null` | no |\n| \u003ca name=\"input_system_controls\"\u003e\u003c/a\u003e [system\\_controls](#input\\_system\\_controls) | A list of namespaced kernel parameters to set in the container, mapping to the --sysctl option to docker run. This is a list of maps: { namespace = \"\", value = \"\"} | \u003cpre\u003elist(object({\u003cbr/\u003e    namespace = string\u003cbr/\u003e    value     = string\u003cbr/\u003e  }))\u003c/pre\u003e | `null` | no |\n| \u003ca name=\"input_ulimits\"\u003e\u003c/a\u003e [ulimits](#input\\_ulimits) | Container ulimit settings. This is a list of maps, where each map should contain \"name\", \"hardLimit\" and \"softLimit\" | \u003cpre\u003elist(object({\u003cbr/\u003e    hardLimit = number\u003cbr/\u003e    name      = string\u003cbr/\u003e    softLimit = number\u003cbr/\u003e  }))\u003c/pre\u003e | `null` | no |\n| \u003ca name=\"input_user\"\u003e\u003c/a\u003e [user](#input\\_user) | The user to run as inside the container. Can be any of these formats: user, user:group, uid, uid:gid, user:gid, uid:group. The default (null) will use the container's configured `USER` directive or root if not set. | `string` | `null` | no |\n| \u003ca name=\"input_version_consistency\"\u003e\u003c/a\u003e [version\\_consistency](#input\\_version\\_consistency) | Specifies whether Amazon ECS will resolve the container image tag provided in the container definition to an image digest. | `string` | `null` | no |\n| \u003ca name=\"input_volumes_from\"\u003e\u003c/a\u003e [volumes\\_from](#input\\_volumes\\_from) | A list of VolumesFrom maps which contain \"sourceContainer\" (name of the container that has the volumes to mount) and \"readOnly\" (whether the container can write to the volume) | \u003cpre\u003elist(object({\u003cbr/\u003e    readOnly        = optional(bool)\u003cbr/\u003e    sourceContainer = string\u003cbr/\u003e  }))\u003c/pre\u003e | `null` | no |\n| \u003ca name=\"input_working_directory\"\u003e\u003c/a\u003e [working\\_directory](#input\\_working\\_directory) | The working directory to run commands inside the container | `string` | `null` | no |\n\n## Outputs\n\n| Name | Description |\n|------|-------------|\n| \u003ca name=\"output_json_map_encoded\"\u003e\u003c/a\u003e [json\\_map\\_encoded](#output\\_json\\_map\\_encoded) | JSON string encoded container definitions for use with other terraform resources such as aws\\_ecs\\_task\\_definition |\n| \u003ca name=\"output_json_map_encoded_list\"\u003e\u003c/a\u003e [json\\_map\\_encoded\\_list](#output\\_json\\_map\\_encoded\\_list) | JSON string encoded list of container definitions for use with other terraform resources such as aws\\_ecs\\_task\\_definition |\n| \u003ca name=\"output_json_map_object\"\u003e\u003c/a\u003e [json\\_map\\_object](#output\\_json\\_map\\_object) | JSON map encoded container definition |\n| \u003ca name=\"output_sensitive_json_map_encoded\"\u003e\u003c/a\u003e [sensitive\\_json\\_map\\_encoded](#output\\_sensitive\\_json\\_map\\_encoded) | JSON string encoded container definitions for use with other terraform resources such as aws\\_ecs\\_task\\_definition (sensitive) |\n| \u003ca name=\"output_sensitive_json_map_encoded_list\"\u003e\u003c/a\u003e [sensitive\\_json\\_map\\_encoded\\_list](#output\\_sensitive\\_json\\_map\\_encoded\\_list) | JSON string encoded list of container definitions for use with other terraform resources such as aws\\_ecs\\_task\\_definition (sensitive) |\n| \u003ca name=\"output_sensitive_json_map_object\"\u003e\u003c/a\u003e [sensitive\\_json\\_map\\_object](#output\\_sensitive\\_json\\_map\\_object) | JSON map encoded container definition (sensitive) |\n\u003c!-- markdownlint-restore --\u003e\n\n\n## Related Projects\n\nCheck out these related projects.\n\n- [terraform-aws-ecs-codepipeline](https://github.com/cloudposse/terraform-aws-ecs-codepipeline) - Terraform module for CI/CD with AWS Code Pipeline and Code Build for ECS\n- [terraform-aws-ecs-events](https://github.com/cloudposse/terraform-aws-ecs-events) - Provides a standard set of ECS events that notify an SNS topic\n- [terraform-aws-ecs-cloudwatch-autoscaling](https://github.com/cloudposse/terraform-aws-ecs-cloudwatch-autoscaling) - Terraform module to autoscale ECS Service based on CloudWatch metrics\n- [terraform-aws-ecs-container-definition](https://github.com/cloudposse/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\n- [terraform-aws-ecs-launch-template](https://github.com/cloudposse/terraform-aws-ecs-launch-template) - Terraform module for generating an AWS Launch Template for ECS that handles draining on Spot Termination Requests\n- [terraform-aws-ecs-web-app](https://github.com/cloudposse/terraform-aws-ecs-web-app) - Terraform module that implements a web app on ECS and supporting AWS resources\n- [terraform-aws-ecs-spot-fleet](https://github.com/cloudposse/terraform-aws-ecs-spot-fleet) - Terraform module to create a diversified spot fleet for ECS clusters\n- [terraform-aws-ecs-cloudwatch-sns-alarms](https://github.com/cloudposse/terraform-aws-ecs-cloudwatch-sns-alarms) - Terraform module to create CloudWatch Alarms on ECS Service level metrics\n- [terraform-aws-ecs-alb-service-task](https://github.com/cloudposse/terraform-aws-ecs-alb-service-task) - Terraform module which implements an ECS service which exposes a web service via ALB\n\n\n\u003e [!TIP]\n\u003e #### Use Terraform Reference Architectures for AWS\n\u003e\n\u003e Use Cloud Posse's ready-to-go [terraform architecture blueprints](https://cloudposse.com/reference-architecture/) for AWS to get up and running quickly.\n\u003e\n\u003e ✅ We build it together with your team.\u003cbr/\u003e\n\u003e ✅ Your team owns everything.\u003cbr/\u003e\n\u003e ✅ 100% Open Source and backed by fanatical support.\u003cbr/\u003e\n\u003e\n\u003e \u003ca href=\"https://cpco.io/commercial-support?utm_source=github\u0026utm_medium=readme\u0026utm_campaign=cloudposse/terraform-aws-ecs-container-definition\u0026utm_content=commercial_support\"\u003e\u003cimg alt=\"Request Quote\" src=\"https://img.shields.io/badge/request%20quote-success.svg?style=for-the-badge\"/\u003e\u003c/a\u003e\n\u003e \u003cdetails\u003e\u003csummary\u003e📚 \u003cstrong\u003eLearn More\u003c/strong\u003e\u003c/summary\u003e\n\u003e\n\u003e \u003cbr/\u003e\n\u003e\n\u003e Cloud Posse is the leading [**DevOps Accelerator**](https://cpco.io/commercial-support?utm_source=github\u0026utm_medium=readme\u0026utm_campaign=cloudposse/terraform-aws-ecs-container-definition\u0026utm_content=commercial_support) for funded startups and enterprises.\n\u003e\n\u003e *Your team can operate like a pro today.*\n\u003e\n\u003e Ensure that your team succeeds by using Cloud Posse's proven process and turnkey blueprints. Plus, we stick around until you succeed.\n\u003e #### Day-0:  Your Foundation for Success\n\u003e - **Reference Architecture.** You'll get everything you need from the ground up built using 100% infrastructure as code.\n\u003e - **Deployment Strategy.** Adopt a proven deployment strategy with GitHub Actions, enabling automated, repeatable, and reliable software releases.\n\u003e - **Site Reliability Engineering.** Gain total visibility into your applications and services with Datadog, ensuring high availability and performance.\n\u003e - **Security Baseline.** Establish a secure environment from the start, with built-in governance, accountability, and comprehensive audit logs, safeguarding your operations.\n\u003e - **GitOps.** Empower your team to manage infrastructure changes confidently and efficiently through Pull Requests, leveraging the full power of GitHub Actions.\n\u003e\n\u003e \u003ca href=\"https://cpco.io/commercial-support?utm_source=github\u0026utm_medium=readme\u0026utm_campaign=cloudposse/terraform-aws-ecs-container-definition\u0026utm_content=commercial_support\"\u003e\u003cimg alt=\"Request Quote\" src=\"https://img.shields.io/badge/request%20quote-success.svg?style=for-the-badge\"/\u003e\u003c/a\u003e\n\u003e\n\u003e #### Day-2: Your Operational Mastery\n\u003e - **Training.** Equip your team with the knowledge and skills to confidently manage the infrastructure, ensuring long-term success and self-sufficiency.\n\u003e - **Support.** Benefit from a seamless communication over Slack with our experts, ensuring you have the support you need, whenever you need it.\n\u003e - **Troubleshooting.** Access expert assistance to quickly resolve any operational challenges, minimizing downtime and maintaining business continuity.\n\u003e - **Code Reviews.** Enhance your team’s code quality with our expert feedback, fostering continuous improvement and collaboration.\n\u003e - **Bug Fixes.** Rely on our team to troubleshoot and resolve any issues, ensuring your systems run smoothly.\n\u003e - **Migration Assistance.** Accelerate your migration process with our dedicated support, minimizing disruption and speeding up time-to-value.\n\u003e - **Customer Workshops.** Engage with our team in weekly workshops, gaining insights and strategies to continuously improve and innovate.\n\u003e\n\u003e \u003ca href=\"https://cpco.io/commercial-support?utm_source=github\u0026utm_medium=readme\u0026utm_campaign=cloudposse/terraform-aws-ecs-container-definition\u0026utm_content=commercial_support\"\u003e\u003cimg alt=\"Request Quote\" src=\"https://img.shields.io/badge/request%20quote-success.svg?style=for-the-badge\"/\u003e\u003c/a\u003e\n\u003e \u003c/details\u003e\n\n## ✨ Contributing\n\nThis project is under active development, and we encourage contributions from our community.\n\n\n\nMany thanks to our outstanding contributors:\n\n\u003ca href=\"https://github.com/cloudposse/terraform-aws-ecs-container-definition/graphs/contributors\"\u003e\n  \u003cimg src=\"https://contrib.rocks/image?repo=cloudposse/terraform-aws-ecs-container-definition\u0026max=24\" /\u003e\n\u003c/a\u003e\n\nFor 🐛 bug reports \u0026 feature requests, please use the [issue tracker](https://github.com/cloudposse/terraform-aws-ecs-container-definition/issues).\n\nIn general, PRs are welcome. We follow the typical \"fork-and-pull\" Git workflow.\n 1. Review our [Code of Conduct](https://github.com/cloudposse/terraform-aws-ecs-container-definition/?tab=coc-ov-file#code-of-conduct) and [Contributor Guidelines](https://github.com/cloudposse/.github/blob/main/CONTRIBUTING.md).\n 2. **Fork** the repo on GitHub\n 3. **Clone** the project to your own machine\n 4. **Commit** changes to your own branch\n 5. **Push** your work back up to your fork\n 6. Submit a **Pull Request** so that we can review your changes\n\n**NOTE:** Be sure to merge the latest changes from \"upstream\" before making a pull request!\n\n### 🌎 Slack Community\n\nJoin our [Open Source Community](https://cpco.io/slack?utm_source=github\u0026utm_medium=readme\u0026utm_campaign=cloudposse/terraform-aws-ecs-container-definition\u0026utm_content=slack) on Slack. It's **FREE** for everyone! Our \"SweetOps\" community is where you get to talk with others who share a similar vision for how to rollout and manage infrastructure. This is the best place to talk shop, ask questions, solicit feedback, and work together as a community to build totally *sweet* infrastructure.\n\n### 📰 Newsletter\n\nSign up for [our newsletter](https://cpco.io/newsletter?utm_source=github\u0026utm_medium=readme\u0026utm_campaign=cloudposse/terraform-aws-ecs-container-definition\u0026utm_content=newsletter) and join 3,000+ DevOps engineers, CTOs, and founders who get insider access to the latest DevOps trends, so you can always stay in the know.\nDropped straight into your Inbox every week — and usually a 5-minute read.\n\n### 📆 Office Hours \u003ca href=\"https://cloudposse.com/office-hours?utm_source=github\u0026utm_medium=readme\u0026utm_campaign=cloudposse/terraform-aws-ecs-container-definition\u0026utm_content=office_hours\"\u003e\u003cimg src=\"https://img.cloudposse.com/fit-in/200x200/https://cloudposse.com/wp-content/uploads/2019/08/Powered-by-Zoom.png\" align=\"right\" /\u003e\u003c/a\u003e\n\n[Join us every Wednesday via Zoom](https://cloudposse.com/office-hours?utm_source=github\u0026utm_medium=readme\u0026utm_campaign=cloudposse/terraform-aws-ecs-container-definition\u0026utm_content=office_hours) for your weekly dose of insider DevOps trends, AWS news and Terraform insights, all sourced from our SweetOps community, plus a _live Q\u0026A_ that you can’t find anywhere else.\nIt's **FREE** for everyone!\n## License\n\n\u003ca href=\"https://opensource.org/licenses/Apache-2.0\"\u003e\u003cimg src=\"https://img.shields.io/badge/License-Apache%202.0-blue.svg?style=for-the-badge\" alt=\"License\"\u003e\u003c/a\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003ePreamble to the Apache License, Version 2.0\u003c/summary\u003e\n\u003cbr/\u003e\n\u003cbr/\u003e\n\nComplete license is available in the [`LICENSE`](LICENSE) file.\n\n```text\nLicensed to the Apache Software Foundation (ASF) under one\nor more contributor license agreements.  See the NOTICE file\ndistributed with this work for additional information\nregarding copyright ownership.  The ASF licenses this file\nto you under the Apache License, Version 2.0 (the\n\"License\"); you may not use this file except in compliance\nwith the License.  You may obtain a copy of the License at\n\n  https://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing,\nsoftware distributed under the License is distributed on an\n\"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\nKIND, either express or implied.  See the License for the\nspecific language governing permissions and limitations\nunder the License.\n```\n\u003c/details\u003e\n\n## Trademarks\n\nAll other trademarks referenced herein are the property of their respective owners.\n\n\n---\nCopyright © 2017-2025 [Cloud Posse, LLC](https://cpco.io/copyright)\n\n\n\u003ca href=\"https://cloudposse.com/readme/footer/link?utm_source=github\u0026utm_medium=readme\u0026utm_campaign=cloudposse/terraform-aws-ecs-container-definition\u0026utm_content=readme_footer_link\"\u003e\u003cimg alt=\"README footer\" src=\"https://cloudposse.com/readme/footer/img\"/\u003e\u003c/a\u003e\n\n\u003cimg alt=\"Beacon\" width=\"0\" src=\"https://ga-beacon.cloudposse.com/UA-76589703-4/cloudposse/terraform-aws-ecs-container-definition?pixel\u0026cs=github\u0026cm=readme\u0026an=terraform-aws-ecs-container-definition\"/\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudposse%2Fterraform-aws-ecs-container-definition","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcloudposse%2Fterraform-aws-ecs-container-definition","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudposse%2Fterraform-aws-ecs-container-definition/lists"}