Bird
0
0

How can you reference a value from a mapping in a CloudFormation template to select an AMI ID based on region?

hard📝 Application Q9 of 15
AWS - CloudFormation
How can you reference a value from a mapping in a CloudFormation template to select an AMI ID based on region?
AUse the Fn::GetAtt function on the mapping
BUse the Ref function on the mapping name
CUse the Fn::FindInMap intrinsic function
DUse the Outputs section to retrieve mapping values
Step-by-Step Solution
Solution:
  1. Step 1: Understand mapping usage

    Mappings store static key-value pairs like region to AMI mappings.
  2. Step 2: Identify correct intrinsic function

    Fn::FindInMap retrieves values from mappings using keys.
  3. Step 3: Differentiate from other functions

    Ref returns parameters or resources, GetAtt gets resource attributes, Outputs expose values but do not retrieve mapping data.
  4. Final Answer:

    Use the Fn::FindInMap intrinsic function -> Option C
  5. Quick Check:

    Mapping lookup = Fn::FindInMap = A [OK]
Quick Trick: Use Fn::FindInMap to get values from mappings [OK]
Common Mistakes:
  • Using Ref on mappings
  • Using GetAtt for mappings
  • Expecting Outputs to retrieve mappings

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More AWS Quizzes