https://github.com/geekcell/terraform-aws-ecs-task-definition
Terraform AWS Module for create an ECS Task Definition.
https://github.com/geekcell/terraform-aws-ecs-task-definition
aws ecs fargate task-definition terraform terraform-module
Last synced: 3 months ago
JSON representation
Terraform AWS Module for create an ECS Task Definition.
- Host: GitHub
- URL: https://github.com/geekcell/terraform-aws-ecs-task-definition
- Owner: geekcell
- License: apache-2.0
- Created: 2023-03-21T14:24:29.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-06-28T11:11:09.000Z (almost 2 years ago)
- Last Synced: 2025-03-01T18:48:52.181Z (3 months ago)
- Topics: aws, ecs, fargate, task-definition, terraform, terraform-module
- Language: HCL
- Homepage: https://www.geekcell.io
- Size: 23.4 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://www.geekcell.io/)
### Code Quality
[](https://github.com/geekcell/terraform-aws-ecs-task-definition/blob/master/LICENSE)
[](https://github.com/geekcell/terraform-aws-ecs-task-definition/releases)
[](https://github.com/geekcell/terraform-aws-ecs-task-definition/actions/workflows/release.yaml)
[](https://github.com/geekcell/terraform-aws-ecs-task-definition/actions/workflows/validate.yaml)
[](https://github.com/geekcell/terraform-aws-ecs-task-definition/actions/workflows/linter.yaml)# Terraform AWS ECS Task Definition Module
Terraform module for creating an AWS ECS Task Definition.
## Inputs
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| [additional\_execute\_role\_policies](#input\_additional\_execute\_role\_policies) | Additional policy ARNs to attach to the execution role. | `list(string)` | `[]` | no |
| [additional\_task\_role\_policies](#input\_additional\_task\_role\_policies) | Additional policy ARNs to attach to the task role. | `list(string)` | `[]` | no |
| [container\_definitions](#input\_container\_definitions) | A list of valid container definitions provided as a valid HCL object list. | `any` | n/a | yes |
| [cpu](#input\_cpu) | Number of CPU units used by the task. | `number` | `1024` | no |
| [cpu\_architecture](#input\_cpu\_architecture) | CPU architecture required by the task. | `string` | `"X86_64"` | no |
| [create\_execution\_role](#input\_create\_execution\_role) | If enabled, will create an execution role and attach the AmazonECSTaskExecutionRolePolicy to it. | `bool` | `true` | no |
| [create\_task\_role](#input\_create\_task\_role) | If enabled, will create a task role. | `bool` | `true` | no |
| [enable\_execute\_command](#input\_enable\_execute\_command) | If enabled, will add the AmazonSSMManagedInstanceCore to the task role. | `bool` | `true` | no |
| [ephemeral\_storage\_size\_in\_gib](#input\_ephemeral\_storage\_size\_in\_gib) | The amount of ephemeral storage (in GiB) to allocate to the task. | `number` | `20` | no |
| [execution\_role\_arn](#input\_execution\_role\_arn) | Execution role ARN to attach to the task. | `string` | `null` | no |
| [execution\_role\_name](#input\_execution\_role\_name) | Name of the execution role to create. | `string` | `null` | no |
| [execution\_role\_name\_prefix](#input\_execution\_role\_name\_prefix) | Whether to prefix the execution role name with the family name. | `bool` | `false` | no |
| [inference\_accelerators](#input\_inference\_accelerators) | List of Elastic Inference accelerators associated with the task. |list(object({| `[]` | no |
name = string
type = string
}))
| [memory](#input\_memory) | Amount (in MiB) of memory used by the task. | `number` | `2048` | no |
| [name](#input\_name) | Family of the task definition. | `string` | n/a | yes |
| [network\_mode](#input\_network\_mode) | The network mode to use for the containers in the task. The valid values are bridge, host, awsvpc, and none. If no network mode is specified, the default is bridge. | `string` | `"awsvpc"` | no |
| [operating\_system\_family](#input\_operating\_system\_family) | OS family required by the task. | `string` | `"LINUX"` | no |
| [proxy\_configuration](#input\_proxy\_configuration) | Configuration details for an App Mesh proxy. |object({| `null` | no |
container_name = string
properties = map(any)
type = optional(string, "APPMESH")
})
| [requires\_compatibilities](#input\_requires\_compatibilities) | The launch type on which to run your service. The valid values are EC2 and FARGATE. | `list(string)` |[| no |
"FARGATE"
]
| [tags](#input\_tags) | Tags to add to the created resources. | `map(any)` | `{}` | no |
| [task\_role\_arn](#input\_task\_role\_arn) | Task role ARN to attach to the task. | `string` | `null` | no |
| [task\_role\_name](#input\_task\_role\_name) | Name of the task role to create. | `string` | `null` | no |
| [task\_role\_name\_prefix](#input\_task\_role\_name\_prefix) | Whether to prefix the task role name with the family name. | `bool` | `false` | no |
| [volumes](#input\_volumes) | A list of volume definitions. |list(object({| `[]` | no |
name = string
host_path = string
docker_volume_configuration = optional(object({
autoprovision = bool
driver = string
driver_opts = map(any)
labels = map(any)
scope = string
}))
efs_volume_configuration = optional(object({
file_system_id = string
root_directory = optional(string)
transit_encryption = optional(string)
transit_encryption_port = optional(number)
authorization_config = optional(object({
access_point_id = string
iam = optional(string)
}))
}))
}))## Outputs
| Name | Description |
|------|-------------|
| [arn](#output\_arn) | The ARN of the task definition. |
| [execution\_role\_arn](#output\_execution\_role\_arn) | The ARN of the IAM role that grants the Amazon ECS container agent permission to make calls to your Amazon ECS container task. |
| [execution\_role\_name](#output\_execution\_role\_name) | The name of the IAM role that grants the Amazon ECS container agent permission to make calls to your Amazon ECS container task. |
| [task\_role\_arn](#output\_task\_role\_arn) | The ARN of the IAM role that allows your Amazon ECS container task to make calls to other AWS services. |
| [task\_role\_name](#output\_task\_role\_name) | The name of the IAM role that allows your Amazon ECS container task to make calls to other AWS services. |## Providers
| Name | Version |
|------|---------|
| [aws](#provider\_aws) | >= 4.36 |## Resources
- resource.aws_ecs_task_definition.main (main.tf#6)
- resource.aws_iam_role_policy_attachment.execute_additional (main.tf#113)
- resource.aws_iam_role_policy_attachment.execute_command (main.tf#139)
- resource.aws_iam_role_policy_attachment.task_additional (main.tf#132)