Terraform Associate Exam QuestionsBrowse all questions from this exam

Terraform Associate Exam - Question 99


You need to deploy resources into two different cloud regions in the same Terraform configuration. To do that, you declare multiple provider configurations as follows:

What meta-argument do you need to configure in a resource block to deploy the resource to the `us-west-2` AWS region?

Show Answer
Correct Answer: C

To deploy resources to a specific provider configuration in Terraform, you use the 'provider' meta-argument in the resource block. Given the provider configurations defined with alias 'west' for the 'us-west-2' region, the correct way to specify this in the resource block is using 'provider = aws.west'. This tells Terraform to use the alternate provider configuration named 'aws.west', hence deploying the resource to the 'us-west-2' region.

Discussion

14 comments
Sign in to comment
bp339Option: C
Jun 4, 2022

https://www.terraform.io/language/providers/configuration

Orpheus123Option: C
May 12, 2022

C - is the correct answer

Roro_BrotherOption: C
May 19, 2022

C is correct

concepts015Option: D
May 20, 2022

I think the right answer is D alias is used in the argument and AWS.WEST is the right way to write the argument

CHRIS12722222
Jun 19, 2022

No, C is correct

bigboi23Option: C
May 18, 2022

Confirmed. C is correct.

elvancedonzyOption: C
Jun 3, 2022

C is Correct

Zam88Option: C
Jun 19, 2022

alias is not meta-argument c is correct

thor7Option: C
Mar 29, 2023

Definitely, C is the correct answer. https://www.terraform.io/language/providers/configuration

Ni33Option: C
May 9, 2023

CCCCCCCCCCC

BereOption: C
Nov 2, 2023

For us-east-1: resource "aws_instance" "example_east" { ami = "ami-abc12345" instance_type = "t2.micro" // No provider meta-argument specified, so it uses the default (us-east-1) } For us-west-2: resource "aws_instance" "example_west" { ami = "ami-xyz67890" instance_type = "t2.micro" provider = aws.west // This directs Terraform to use the 'us-west-2' region provider configuration } With this setup, Terraform will deploy the example_east instance in the us-east-1 region and the example_west instance in the us-west-2 region.

tracemeOption: C
May 11, 2022

answer is C

EltoothOption: C
Jun 29, 2022

C is correct answer.

NzudinOption: B
Mar 1, 2023

https://developer.hashicorp.com/terraform/language/providers/configuration#selecting-alternate-provider-configurations

Power123Option: C
Mar 31, 2023

Answer is C