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

Prepare for the HashiCorp Terraform Associate Exam. Utilize flashcards and multiple-choice questions with detailed hints and explanations. Boost your confidence and be ready for success!

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