Skip to main content
# Use the container_definition output in a task definition
resource "aws_ecs_task_definition" "example" {
  family                = "example"
  container_definitions = jsonencode([module.ecs_container_definition.container_definition])
}
When passing the container definition into a task definition, use jsonencode([module.ecs_container_definition.container_definition]) rather than the container_definition_json output.

Container Definition

container_definition
map
The container definition as a Terraform map. Use jsonencode([module.name.container_definition]) when passing to a task definition.
container_definition_json
string
The container definition as a JSON-encoded string. Note: prefer using jsonencode([module.name.container_definition]) over this output when passing into a task definition.

CloudWatch Logging

cloudwatch_log_group_name
string
Name of the CloudWatch log group created for this container.
cloudwatch_log_group_arn
string
ARN of the CloudWatch log group.

Build docs developers (and LLMs) love