Answer – C and E
Option A is incorrect because you need to retain or keep the snapshots of the EBS volumes to launch similar instances in the new region.
Option B is incorrect because a DynamoDB table with the same name can be created in different regions. They have to be unique in a single region.
Option C is CORRECT because you need to get the name of the Availability Zone based on the region in which the template would be used.
Option D is incorrect because you do not need to define IAM users per region as they are global.
Option E is CORRECT because the AMI ID would be needed to launch similar instances in the new region where the template would be used.
More information on CloudFormation intrinsic functions:
You can use the Fn::GetAZs function of CloudFormation to get the AZ of the region and assign it to the ELB.An example of the Fn::GetAZs function is given below
{ "Fn::GetAZs" : "" }
{ "Fn::GetAZs" : { "Ref" : "AWS::Region" } }
{ "Fn::GetAZs" : "us-east-1" }
An example of the FindInMap is shown below. This is useful when you want to get particular values region wise which can be used as parameters. Since the Launch configuration contains the AMI ID information and the AMI ID is different in different regions, you need to recreate the Launch Configurations based on the AMI ID.{
...
"Mappings" : {
"RegionMap" : {
"us-east-1" : { "32" : "ami-6411e20d", "64" : "ami-7a11e213" },
"us-west-1" : { "32" : "ami-c9c7978c", "64" : "ami-cfc7978a" },
"eu-west-1" : { "32" : "ami-37c2f643", "64" : "ami-31c2f645" },
"ap-southeast-1" : { "32" : "ami-66f28c34", "64" : "ami-60f28c32" },
"ap-northeast-1" : { "32" : "ami-9c03a89d", "64" : "ami-a003a8a1" }
}
},
"Resources" : {
"myEC2Instance" : {
"Type" : "AWS::EC2::Instance",
"Properties" : {
"ImageId" : { "Fn::FindInMap" : [ "RegionMap", { "Ref" : "AWS::Region" }, "32"]},
"InstanceType" : "m1.small"
}
}
}
}
For more information on the Fn::FindInMap function, please refer to the below link-
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference.html
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-findinmap.html