TA-002-P · Question #429
You are creating a Terraform configuration which needs to make use of multiple providers, one for AWS and one for Datadog. Which of the following provider blocks would allow you to do this?
The correct answer is B. Option B. To use multiple distinct providers like AWS and Datadog, you must declare separate provider blocks for each, specifying their respective names and configurations.
Question
You are creating a Terraform configuration which needs to make use of multiple providers, one for AWS and one for Datadog. Which of the following provider blocks would allow you to do this?
Options
- AOption A
- BOption B
- COption C
How the community answered
(41 responses)- A10% (4)
- B83% (34)
- C7% (3)
Why each option
To use multiple distinct providers like AWS and Datadog, you must declare separate `provider` blocks for each, specifying their respective names and configurations.
Option A likely represents an incorrect attempt to combine or improperly configure multiple providers, as valid Terraform requires distinct blocks for each provider type.
This option correctly shows separate `provider` blocks for `aws` and `datadog`, each with their respective configurations such as `region` for AWS and `api_key` for Datadog, which is the standard way to configure multiple providers.
Option C probably depicts an invalid or incomplete way to define multiple providers, failing to correctly separate or configure the `aws` and `datadog` providers as required by Terraform HCL.
Concept tested: Declaring multiple providers
Source: https://developer.hashicorp.com/terraform/language/providers/configuration
Topics
Community Discussion
No community discussion yet for this question.