In Terraform 0.12 provider configuration, which keyword controls the version constraint for a provider?

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

In Terraform 0.12 provider configuration, which keyword controls the version constraint for a provider?

Explanation:
Version is the keyword used inside the provider configuration block within the required_providers section to specify which provider versions are acceptable. This constraint tells Terraform which versions it may install for that provider, ensuring compatibility with your configuration. For example, in Terraform 0.12 you declare something like: terraform { required_providers { aws = { source = "hashicorp/aws" version = "~> 3.0" } } } Here, the version line sets the constraint for the AWS provider. The other terms aren’t the Terraform keyword used for this purpose, and required_providers is just the container that holds these constraints, not the constraint itself.

Version is the keyword used inside the provider configuration block within the required_providers section to specify which provider versions are acceptable. This constraint tells Terraform which versions it may install for that provider, ensuring compatibility with your configuration.

For example, in Terraform 0.12 you declare something like:

terraform {

required_providers {

aws = {

source = "hashicorp/aws"

version = "~> 3.0"

}

}

}

Here, the version line sets the constraint for the AWS provider. The other terms aren’t the Terraform keyword used for this purpose, and required_providers is just the container that holds these constraints, not the constraint itself.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy