TA-002-P · Question #301
The following is a snippet from a Terraform configuration file: Which, when validated, results in the following error: Fill in the blank in the error message with the correct string from the list belo
The correct answer is D. alias. The validation error references 'alias', which is the required argument when configuring multiple instances of the same provider in Terraform.
Question
The following is a snippet from a Terraform configuration file:
Which, when validated, results in the following error:
Fill in the blank in the error message with the correct string from the list below.
Options
- Aversion
- Bmulti
- Clabel
- Dalias
How the community answered
(35 responses)- A3% (1)
- B3% (1)
- C6% (2)
- D89% (31)
Why each option
The validation error references 'alias', which is the required argument when configuring multiple instances of the same provider in Terraform.
'version' is a provider meta-argument used to pin provider versions and is unrelated to the error produced by a missing or invalid alias in a multi-provider configuration.
'multi' is not a valid Terraform provider configuration argument or a keyword that appears in Terraform validation errors.
'label' is not a valid provider configuration argument; the correct term for distinguishing multiple instances of the same provider is alias.
When a Terraform configuration uses multiple instances of the same provider (for example, targeting multiple AWS regions), each additional provider block must include an alias argument to give it a unique identifier. The validation error shown occurs when a resource or module references a provider configuration by alias but the alias value is missing or incorrectly specified in the provider block.
Concept tested: Terraform provider alias for multiple provider configurations
Source: https://developer.hashicorp.com/terraform/language/providers/configuration#alias-multiple-provider-configurations
Topics
Community Discussion
No community discussion yet for this question.