Terraform Associate Exam QuestionsBrowse all questions from this exam

Terraform Associate Exam - Question 265


When using multiple configurations of the same Terraform provider, what meta-argument must be included in any non-default provider configurations?

Show Answer
Correct Answer: B

When using multiple configurations of the same Terraform provider, the meta-argument 'alias' must be included in any non-default provider configurations. This allows Terraform to distinguish between the multiple provider instances and ensure that the correct configuration is used for the appropriate resources.

Discussion

3 comments
Sign in to comment
DevoteamAnalytixOption: B
Jun 26, 2023

https://developer.hashicorp.com/terraform/language/providers/configuration#alias-multiple-provider-configurations

Sam1101Option: B
Jul 31, 2023

To create multiple configurations for a given provider, include multiple provider blocks with the same provider name. For each additional non-default configuration, use the alias meta-argument to provide an extra name segment.

090200fOption: B
Aug 3, 2024

https://developer.hashicorp.com/terraform/language/meta-arguments/resource-provider The provider meta-argument specifies which provider configuration to use for a resource, overriding Terraform's default behavior of selecting one based on the resource type name. Its value should be an unquoted <PROVIDER>.<ALIAS> reference. # default configuration provider "google" { region = "us-central1" } # alternate configuration, whose alias is "europe" provider "google" { alias = "europe" region = "europe-west1" }