Skip to main content
This example demonstrates the full range of container definition parameters available in the container-definition sub-module. It creates two container definitions: a comprehensive one with nearly every parameter set, and a minimal one.

What is created

  • A container definition with FireLens logging, health check, resource requirements, security options, environment variables, secrets, and mount points
  • A simple container definition with minimal configuration
  • CloudWatch log groups (managed by Terraform)
This example only creates container definition resources (CloudWatch log groups). It does not create a cluster, service, or task definition. Use these outputs with aws_ecs_task_definition or with the service module’s container_definitions argument.

Code

Using the output

To use container definition outputs in an aws_ecs_task_definition resource:

Container Definition Inputs

Full reference for all container definition parameters.

Logging Guide

CloudWatch and FireLens logging configuration patterns.