
Explanation:
Fn::FindInMap looks up the AMI value using the current region (AWS::Region) as the key. This makes the template portable — the correct AMI is chosen automatically per region.
Ultimate access to all questions.
Question 10: A SysOps admin reviews this template snippet. What does the Mappings section achieve here?
Mappings:
RegionAMIMap:
us-east-1:
AMI: ami-0a1b2c3d4e5f67890
us-west-2:
AMI: ami-0f9e8d7c6b5a43210
Resources:
WebServer:
Type: AWS::EC2::Instance
Properties:
ImageId: !FindInMap
- RegionAMIMap
- !Ref AWS::Region
- AMI
Mappings:
RegionAMIMap:
us-east-1:
AMI: ami-0a1b2c3d4e5f67890
us-west-2:
AMI: ami-0f9e8d7c6b5a43210
Resources:
WebServer:
Type: AWS::EC2::Instance
Properties:
ImageId: !FindInMap
- RegionAMIMap
- !Ref AWS::Region
- AMI
A
It hard-codes the AMI to ami-0a1b2c3d4e5f67890 in all regions
B
It selects the correct region-specific AMI automatically at deploy time
C
It creates two EC2 instances, one per region
D
Mappings are ignored — !FindInMap always returns null
E
None of the above
F
Not applicable
No comments yet.