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

Prepare for the HashiCorp Terraform Associate Exam with quizzes, flashcards, and multiple-choice questions. Each question includes hints and explanations. Boost your confidence and ace your exam!

Multiple Choice

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

Explanation:
When you configure more than one configuration for the same provider, you need an alias to tell Terraform which settings to use for each place in your code. The alias acts as a handle for a specific provider block and lets resources reference that exact configuration with provider = <provider>.<alias>. Without an alias, Terraform wouldn’t know which configuration to apply to a resource, leading to ambiguity when multiple configurations exist. This is why the alias meta-argument is the correct choice. It distinguishes non-default provider blocks and enables precise attachment of resources to the intended provider configuration. The other options aren’t about selecting or differentiating provider configurations: depends_on controls creation order between resources, not provider selection; name and id aren’t valid meta-arguments for provider blocks.

When you configure more than one configuration for the same provider, you need an alias to tell Terraform which settings to use for each place in your code. The alias acts as a handle for a specific provider block and lets resources reference that exact configuration with provider = .. Without an alias, Terraform wouldn’t know which configuration to apply to a resource, leading to ambiguity when multiple configurations exist.

This is why the alias meta-argument is the correct choice. It distinguishes non-default provider blocks and enables precise attachment of resources to the intended provider configuration.

The other options aren’t about selecting or differentiating provider configurations: depends_on controls creation order between resources, not provider selection; name and id aren’t valid meta-arguments for provider blocks.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy