
- Share values between stacks (e.g., VPC IDs, bucket names).
- Return connection information (e.g., database endpoints, load balancer DNS).
- Surface important runtime identifiers for automation, CI/CD, or human operators.
Producer stack (YAML) — declare an output and export it
- Use !Ref to return the resource’s logical reference (often the name or ID).
- If you need a specific attribute (for example, an ARN or DNS name), use !GetAtt or other intrinsics as appropriate.
- Export names must be unique within an AWS account and region.
- You cannot delete an export while other stacks import it — remove imports before deleting the export.
- Avoid exposing secrets (database passwords, API keys) via Outputs — these values are visible in the Console, CLI, and API.
- Use descriptive Export names (including the stack name or environment) to avoid collisions and make cross-stack references clear.
- Prefer strong naming conventions for exported values to make tracking and cleanup easier.
Do not include sensitive or secret data in Outputs — these values are visible to anyone who can view the stack and can be retrieved via API/CLI.
Use descriptive Export names (for example including the stack name and environment) to avoid naming collisions and make cross-stack references clearer.
- CloudFormation Outputs section — AWS Docs
- CloudFormation describe-stacks — AWS CLI
- AWS CloudFormation Concepts