HashiCorp
TA-002-P · Question #143
You want to use different AMI images for different regions and for the purpose you have defined following code block. 1. variable "images" 2. { 3. type = "map" 4. 5. default = { 6. us-east-1 = "image-
Sign in or unlock TA-002-P to reveal the answer and full explanation for question #143. The question stem and answer options stay visible for context.
Understand Terraform basics
Question
You want to use different AMI images for different regions and for the purpose you have defined following code block. 1. variable "images" 2. { 3. type = "map" 4. 5. default = { 6. us-east-1 = "image-1234" 7. us-west-2 = "image-4567" 8. us-west-1 = "image-4589" 9. } 10. } What of the following approaches needs to be followed in order to select image-4589?
Options
- Avar.images["us-west-1"]
- Bvar.images[3]
- Cvar.images[2]
- Dlookup(var.images["us-west-1"]
Unlock TA-002-P to see the answer
You've previewed enough free TA-002-P questions. Unlock TA-002-P for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.
Topics
#Terraform variables#Map data type#HCL syntax#Variable access