AWS › AWS Secrets Manager & Parameter Store

How can Secrets Manager and Parameter Store be integrated with container orchestration platforms like ECS and EKS to securely inject secrets into running applications?

Advanced

Answer

ECS supports referencing Secrets Manager or Parameter Store values directly within a task definition, automatically injecting the decrypted secret value as an environment variable when the container starts, while EKS commonly uses a Secrets Store CSI Driver to mount secrets directly as files within a pod, both approaches avoiding the need to bake sensitive values into a container image or pass them through less secure channels like plain environment variables defined directly in a deployment manifest.
{
  "containerDefinitions": [{
    "secrets": [{"name": "DB_PASSWORD", "valueFrom": "arn:aws:secretsmanager:us-east-1:123456789012:secret:db-password"}]
  }]
}
Real-world example A company running its microservices on ECS references its database password directly from Secrets Manager within each task definition, ensuring the actual credential value never appears anywhere in the container image or in plain text configuration files.

Common follow-ups: How does the Secrets Store CSI Driver work differently on EKS compared to ECS task definition integration?;What happens if a container needs a secret value updated while it is already running?