
- 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.
| Use case | Recommendation | Example |
|---|---|---|
| Cross-stack sharing | Export the value in the producing stack and ImportValue in the consumer stack | Share an S3 bucket name or VPC ID |
| Automation / pipelines | Retrieve Outputs via CLI/SDK after stack creation | Use describe-stacks in CI pipeline |
| Human visibility | Add descriptive Description fields | Show endpoint URLs and ARNs in the Console |
- 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