My task is basic - I want to use CloudFormation to set up an EC2 instance with some arbitrary AMI that I like. However, for some reason this isn't as simple as just putting in the ID number of the image that I want.
As we see in their tutorial CloudFormation template, for the ImageId section they have:
Properties:
ImageId: !FindInMap [ AWSRegionArch2AMI, !Ref 'AWS::Region' , !FindInMap [ AWSInstanceType2Arch, !Ref InstanceType, Arch ] ]
When searching among the available EC2 images, I don't see anything called "AWSRegionArch2AMI", so I have no idea why this keyword is able to specify their desired AMI and allow this template to function.
So for example say I want to have my CloudFormation template create an instance with this popular, publicly available AMI:
Red Hat Enterprise Linux 8 (HVM), SSD Volume Type - ami-08949fb6466dd2cf3
What should I specify in the ImageId field to get CloudFormation to use this AMI?
Additionally, why is it standard to use these complex programmatic arguments instead of just a UID indicating the image I want?