{"id":14956489,"url":"https://github.com/mongodb/terraform-aws-ecs-task-definition","last_synced_at":"2025-11-11T21:05:51.544Z","repository":{"id":47796671,"uuid":"173968989","full_name":"mongodb/terraform-aws-ecs-task-definition","owner":"mongodb","description":"A Terraform module for creating Amazon ECS Task Definitions","archived":false,"fork":false,"pushed_at":"2024-05-11T17:44:55.000Z","size":372,"stargazers_count":86,"open_issues_count":12,"forks_count":73,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-05-07T00:10:26.247Z","etag":null,"topics":["aws","aws-ecs","terraform","terraform-modules"],"latest_commit_sha":null,"homepage":"https://registry.terraform.io/modules/mongodb/ecs-task-definition/aws/","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/mongodb.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-03-05T15:10:01.000Z","updated_at":"2024-11-24T02:46:23.000Z","dependencies_parsed_at":"2024-08-23T00:10:49.423Z","dependency_job_id":null,"html_url":"https://github.com/mongodb/terraform-aws-ecs-task-definition","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/mongodb/terraform-aws-ecs-task-definition","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mongodb%2Fterraform-aws-ecs-task-definition","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mongodb%2Fterraform-aws-ecs-task-definition/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mongodb%2Fterraform-aws-ecs-task-definition/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mongodb%2Fterraform-aws-ecs-task-definition/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mongodb","download_url":"https://codeload.github.com/mongodb/terraform-aws-ecs-task-definition/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mongodb%2Fterraform-aws-ecs-task-definition/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278734413,"owners_count":26036404,"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","status":"online","status_checked_at":"2025-10-07T02:00:06.786Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","aws-ecs","terraform","terraform-modules"],"created_at":"2024-09-24T13:13:06.501Z","updated_at":"2025-10-07T06:56:44.564Z","avatar_url":"https://github.com/mongodb.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"![GitHub release](https://img.shields.io/github/release/mongodb/terraform-aws-ecs-task-definition.svg?style=flat-square) ![GitHub](https://img.shields.io/github/license/mongodb/terraform-aws-ecs-task-definition.svg?style=flat-square)\n\n\u003e A Terraform module for creating Amazon [ECS Task Definitions](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html)\n\n## NOTICE\n\n**THIS MODULE IS NOT COMPATIBLE WITH VERSIONS OF TERRAFORM LESS THAN v0.12.x. PLEASE REFER TO THE OFFICIAL [DOCUMENTATION](https://www.terraform.io/upgrade-guides/0-12.html) FOR UPGRADING TO THE LATEST VERSION OF TERRAFORM.**\n\n## Contents\n\n- [Motivation](#motivation)\n  - [Use Cases](#use-cases)\n- [Requirements](#requirements)\n- [Usage](#usage)\n  - [Multiple Container Definitions](#multiple-container-definitions)\n- [Inputs](#inputs)\n- [Outputs](#outputs)\n- [Testing](#testing)\n- [License](#license)\n\n## Motivation\n\nThe purpose of this module is to generate a valid Amazon [ECS Task Definition](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html) dynamically. A task definition is required to run Docker containers in Amazon ECS. A task definition contains a list of [container definitions](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html#container_definitions) received by the Docker daemon to create a container instance.\n\n### Use Cases\n\n- Have Terraform generate valid task definitions dynamically\n- Update the ECS task definition and trigger new [service](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs_services.html) deployments automatically (see [examples/ecs_update_service.tf](examples/ecs_update_service.tf))\n\n## Requirements\n\n- [Terraform](https://www.terraform.io/downloads.html)\n- [Go](https://golang.org/dl/) (for testing)\n\n## Usage\n\nThis module uses the same parameters as the [`ContainerDefinition`](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_ContainerDefinition.html) object. Given the following Terraform configuration:\n\n```hcl\nprovider \"aws\" {}\n\nmodule \"mongo-task-definition\" {\n  source = \"github.com/mongodb/terraform-aws-ecs-task-definition\"\n\n  family = \"mongo\"\n  image  = \"mongo:3.6\"\n  memory = 512\n  name   = \"mongo\"\n\n  portMappings = [\n    {\n      containerPort = 27017\n    },\n  ]\n}\n```\n\nInvoking the commands defined below creates an ECS task definition with the following [`containerDefinitions`](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_RegisterTaskDefinition.html#ECS-RegisterTaskDefinition-request-containerDefinitions):\n\n    $ terraform init\n    $ terraform apply\n\n```json\n[\n  {\n    \"command\": null,\n    \"cpu\": null,\n    \"disableNetworking\": false,\n    \"dnsSearchDomains\": null,\n    \"dnsServers\": null,\n    \"dockerLabels\": null,\n    \"dockerSecurityOptions\": null,\n    \"entryPoint\": null,\n    \"environment\": null,\n    \"essential\": true,\n    \"extraHosts\": null,\n    \"healthCheck\": null,\n    \"hostname\": null,\n    \"image\": \"mongo:3.6\",\n    \"interactive\": false,\n    \"links\": null,\n    \"linuxParameters\": null,\n    \"logConfiguration\": null,\n    \"memory\": 512,\n    \"memoryReservation\": null,\n    \"mountPoints\": null,\n    \"name\": \"mongo\",\n    \"portMappings\": [{\"containerPort\":27017}],\n    \"privileged\": false,\n    \"pseudoTerminal\": false,\n    \"readonlyRootFilesystem\": false,\n    \"repositoryCredentials\": null,\n    \"resourceRequirements\": null,\n    \"secrets\": null,\n    \"systemControls\": null,\n    \"ulimits\": null,\n    \"user\": null,\n    \"volumesFrom\": null,\n    \"workingDirectory\": null\n  }\n]\n```\n\n### Multiple Container Definitions\n\nBy default, this module creates a task definition with a single container definition. To create a task definition with multiple container definitions, refer to the documentation of the [`merge`](modules/merge) module.\n\n\u003c!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK --\u003e\n## Providers\n\n| Name | Version |\n|------|---------|\n| aws | n/a |\n| template | n/a |\n\n## Inputs\n\n| Name | Description | Type | Default | Required |\n|------|-------------|------|---------|:-----:|\n| command | The command that is passed to the container | `list(string)` | `[]` | no |\n| cpu | The number of cpu units reserved for the container | `number` | `0` | no |\n| disableNetworking | When this parameter is true, networking is disabled within the container | `bool` | `false` | no |\n| dnsSearchDomains | A list of DNS search domains that are presented to the container | `list(string)` | `[]` | no |\n| dnsServers | A list of DNS servers that are presented to the container | `list(string)` | `[]` | no |\n| dockerLabels | A key/value map of labels to add to the container | `map(string)` | `{}` | no |\n| dockerSecurityOptions | A list of strings to provide custom labels for SELinux and AppArmor multi-level security systems | `list(string)` | `[]` | no |\n| entryPoint | The entry point that is passed to the container | `list(string)` | `[]` | no |\n| environment | The environment variables to pass to a container | `list(map(string))` | `[]` | no |\n| 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 |\n| 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 |\n| extraHosts | A list of hostnames and IP address mappings to append to the /etc/hosts file on the container | `list(string)` | `[]` | no |\n| 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 |\n| healthCheck | The health check command and associated configuration parameters for the container | `any` | `{}` | no |\n| hostname | The hostname to use for your container | `string` | `\"\"` | no |\n| image | The image used to start a container | `string` | `\"\"` | no |\n| 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 |\n| ipc\\_mode | The IPC resource namespace to use for the containers in the task | `string` | `\"host\"` | no |\n| links | The link parameter allows containers to communicate with each other without the need for port mappings | `list(string)` | `[]` | no |\n| linuxParameters | Linux-specific modifications that are applied to the container, such as Linux KernelCapabilities | `any` | `{}` | no |\n| logConfiguration | The log configuration specification for the container | `any` | `{}` | no |\n| memory | The hard limit (in MiB) of memory to present to the container | `number` | `0` | no |\n| memoryReservation | The soft limit (in MiB) of memory to reserve for the container | `number` | `0` | no |\n| mountPoints | The mount points for data volumes in your container | `list(any)` | `[]` | no |\n| name | The name of a container | `string` | `\"\"` | no |\n| network\\_mode | The Docker networking mode to use for the containers in the task | `string` | `\"bridge\"` | no |\n| pid\\_mode | The process namespace to use for the containers in the task | `string` | `\"host\"` | no |\n| placement\\_constraints | An array of placement constraint objects to use for the task | `list(string)` | `[]` | no |\n| portMappings | The list of port mappings for the container | `list(any)` | `[]` | no |\n| 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 |\n| pseudoTerminal | When this parameter is true, a TTY is allocated | `bool` | `false` | no |\n| readonlyRootFilesystem | When this parameter is true, the container is given read-only access to its root file system | `bool` | `false` | no |\n| register\\_task\\_definition | Registers a new task definition from the supplied family and containerDefinitions | `bool` | `true` | no |\n| repositoryCredentials | The private repository authentication credentials to use | `map(string)` | `{}` | no |\n| requires\\_compatibilities | The launch type required by the task | `list(string)` | `[]` | no |\n| resourceRequirements | The type and amount of a resource to assign to a container | `list(string)` | `[]` | no |\n| secrets | The secrets to pass to the container | `list(map(string))` | `[]` | no |\n| systemControls | A list of namespaced kernel parameters to set in the container | `list(string)` | `[]` | no |\n| tags | The metadata that you apply to the task definition to help you categorize and organize them | `map(string)` | `{}` | no |\n| 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 |\n| ulimits | A list of ulimits to set in the container | `list(any)` | `[]` | no |\n| user | The user name to use inside the container | `string` | `\"\"` | no |\n| volumes | A list of volume definitions in JSON format that containers in your task may use | `list(any)` | `[]` | no |\n| volumesFrom | Data volumes to mount from another container | `list(object)` | `[]` | no |\n| workingDirectory | The working directory in which to run commands inside the container | `string` | `\"\"` | no |\n\n## Outputs\n\n| Name | Description |\n|------|-------------|\n| arn | The full Amazon Resource Name (ARN) of the task definition |\n| container\\_definitions | A list of container definitions in JSON format that describe the different containers that make up your task |\n| family | The family of your task definition, used as the definition name |\n| revision | The revision of the task in a particular family |\n\n\u003c!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK --\u003e\n\n## Testing\n\nThis module uses [Terratest](https://github.com/gruntwork-io/terratest), a Go library maintained by [Gruntwork](https://gruntwork.io/), to write automated tests for your infrastructure code. To invoke tests, run the following commands:\n\n    $ go test -v ./...\n\n## License\n\n[Apache License 2.0](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmongodb%2Fterraform-aws-ecs-task-definition","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmongodb%2Fterraform-aws-ecs-task-definition","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmongodb%2Fterraform-aws-ecs-task-definition/lists"}