This module is used internally by the service module for each container in
container_definitions. You can also use it standalone to generate container definition JSON.Module Controls
Create a CloudWatch log group for this container. Default:
true.CloudWatch Log Group
Custom log group name. Default:
null (auto-generated).Use log group name as prefix. Default:
false.Log retention in days. Set to
0 to keep logs indefinitely. Default: 14.KMS Key ARN for log encryption. Default:
null.Log class:
STANDARD or INFREQUENT_ACCESS. Default: null.Container Definition
Container name (up to 255 letters, numbers, underscores, hyphens). Default:
null.Docker image URI. Supports Docker Hub, ECR, and any registry in
repository-url/image:tag or repository-url/image@digest format. Default: null.CPU units to reserve. Optional for Fargate tasks (task-level CPU is required). Default:
null.Hard memory limit in MiB. Container is killed if exceeded. Default:
null.Soft memory limit in MiB. Docker tries to maintain this but allows burst. Default:
null.If
true, all other containers stop when this container fails. Default: null.Command passed to the container (overrides Docker CMD). Default:
null.Entry point (overrides Docker ENTRYPOINT). Default:
null.Working directory for commands. Default:
null.User to run as inside the container. Formats:
user, user:group, uid, uid:gid. Default: null.Environment variables as a list of
{ name, value } objects. Default: null.S3 files containing environment variables. Default:
null.Secrets from Secrets Manager or SSM Parameter Store. Each entry has
name and valueFrom. Default: null.Port mappings for the container.Default:
null.Volume mount points.Default:
null.Mount volumes from another container. Default:
null.Logging
Configure CloudWatch logging for this container. Set to
false when using FireLens or other log drivers. Default: true.Enable ECS Exec for this container. Default:
false.Custom log configuration (overrides CloudWatch default).Default:
{}.FireLens log router configuration.Default:
null.Health Check
Container health check configuration.Default:
null.Restart Policy
Container restart policy.Default:
{ enabled = true }.Resource Requirements
GPU resource requirements. Each entry has
type (always GPU) and value (number of GPUs). Default: null.Networking
Container hostname. Default:
null.DNS server IP addresses. Default:
null.DNS search domains. Default:
null.Additional
/etc/hosts entries with hostname and ipAddress. Default: null.Container links (bridge network mode only). Default:
null.Disable networking within the container. Default:
null.Security
Give container read-only access to root filesystem. Default:
true.Give container elevated host privileges (similar to root). Default:
false.SELinux/AppArmor labels (not valid for Fargate). Default:
null.gMSA credential specs for Windows containers. Default:
null.Private registry credentials from Secrets Manager.Default:
null.Container Behavior
Container dependency conditions.Default:
null.Seconds to wait before giving up on dependency resolution. Default:
30.Seconds to wait before forcefully killing the container on stop. Default:
120.Allocate stdin/tty (for interactive applications). Default:
false.Allocate a TTY. Default:
false.Whether ECS resolves image tags to digests:
enabled or disabled. Default: "disabled".Linux Parameters
Linux kernel capabilities and configuration.Default:
{}.Container ulimit settings (name, softLimit, hardLimit). Default:
null.Namespaced kernel parameters (namespace, value). Default:
null.Docker Labels
Key/value labels to add to the container. Default:
null.Context
Service name associated with this container definition. Used in auto-generated CloudWatch log group names. Default:
null.OS family for the task:
LINUX or WINDOWS_SERVER_*. Default: "LINUX".AWS region. Defaults to provider region. Default:
null.Tags for all resources. Default:
{}.
