Skip to main content
CloudFormation Outputs are the values a stack returns after it creates resources. Outputs let you expose important runtime information—such as resource IDs, ARNs, endpoints, or configuration values—so other people, tools, or stacks can consume them. Outputs are visible in the AWS Management Console (the stack’s Outputs tab) and can be retrieved programmatically using the AWS CLI or any AWS SDKs. They are especially useful for sharing resource metadata between stacks (cross-stack references) or for returning created resource details for automation workflows.
A slide titled "Outputs – Introduction" showing created resources flowing into a CloudFormation stack which returns outputs as values. It explains outputs are values returned after creating resources and highlights "Resource IDs" as an important example.
Why use Outputs?
  • 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.
When to use Outputs (quick reference) Producer stack (YAML) — declare an output and export it
Notes:
  • 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.
Consumer stack (YAML) — import the exported value
Retrieve outputs via AWS CLI
The command returns JSON that includes an Outputs array. Example:
Key considerations and best practices
  • 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.
Links and references

Watch Video