A provider configuration block is required in every Terraform configuration.

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

A provider configuration block is required in every Terraform configuration.

Explanation:
In Terraform, a provider configuration block is used to tell Terraform how to connect to and authenticate with a provider, and to set provider-specific options like regions or credentials. However, you don’t have to include one in every configuration. If you rely on environment variables, shared credentials files, or the provider’s defaults, Terraform can still manage resources without an explicit provider block. This means you can declare resources and let Terraform pick up settings from things like AWS_REGION or AWS_PROFILE, for example. You’d add a provider block when you need to customize those settings, use a specific region or account, or configure multiple providers (including aliases) to manage resources from different sources. The statement is not universally true because configurations can work with implicit settings, and not true for “only for modules” since provider configuration applies to how the root module and its modules interact with the provider.

In Terraform, a provider configuration block is used to tell Terraform how to connect to and authenticate with a provider, and to set provider-specific options like regions or credentials. However, you don’t have to include one in every configuration. If you rely on environment variables, shared credentials files, or the provider’s defaults, Terraform can still manage resources without an explicit provider block. This means you can declare resources and let Terraform pick up settings from things like AWS_REGION or AWS_PROFILE, for example.

You’d add a provider block when you need to customize those settings, use a specific region or account, or configure multiple providers (including aliases) to manage resources from different sources. The statement is not universally true because configurations can work with implicit settings, and not true for “only for modules” since provider configuration applies to how the root module and its modules interact with the provider.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy