Pseudo Parameters and AWS-Provided Values
What you'll learn: How to use AWS CloudFormation's built-in pseudo parameters to automatically reference runtime values like region, account ID, and stack name without hardcoding them.
What Are Pseudo Parameters?
Pseudo parameters are special, pre-populated values that AWS CloudFormation provides automatically when your stack runs. Think of them as "magic variables" that CloudFormation fills in for you based on where and how your stack is deployed—no manual input required.
Unlike the parameters you define yourself (covered in lesson 853), pseudo parameters are always available and always prefixed with AWS::.
Common Pseudo Parameters
Here are the most useful built-in values:
AWS::Region— The AWS region where your stack is created (e.g.,us-east-1)AWS::AccountId— Your 12-digit AWS account IDAWS::StackName— The name you gave this stackAWS::StackId— The unique identifier for this stackAWS::NotificationARNs— SNS topics receiving stack eventsAWS::NoValue— A special value that removes a property
Why Use Them?
Instead of hardcoding us-west-2 in dozens of places, reference AWS::Region. Your template becomes portable across regions and accounts automatically. You can also use AWS::StackName to create unique resource names or tag everything consistently.
Reference Syntax
Use the Ref intrinsic function:
BucketName: !Sub "${AWS::StackName}-logs-${AWS::Region}"
This creates a bucket name like my-app-stack-logs-us-east-1 without you typing those values manually.
Key Takeaway: Pseudo parameters like AWS::Region, AWS::AccountId, and AWS::StackName are AWS-provided runtime values that make your CloudFormation templates portable, dynamic, and environment-aware without hardcoding infrastructure details.