TERRAFORM-ASSOCIATE-003 practice question 27 of 30

[Manage Terraform Resources and Providers] What does this code do? terraform { required_providers { aws = ">= 3.0" }}

Full set: 226 questions
Answer options
A: Requires any version of the AWS provider > = 3.0 and <4.0
B: Requires any version of the AWS provider >= 3.0 Correct answer
C: Requires any version of the AWS provider > = 3.0 major release. like 4.1
D: Requires any version of the AWS provider > 3.0
Correct Answer:
B. Requires any version of the AWS provider >= 3.0
Explanation

The requiredproviders block within the terraform configuration block is used to specify the versions of providers required for the configuration. The expression aws = ">= 3.0" sets a version constraint for the AWS provider. The >= operator signifies "greater than or equal to". Therefore, this constraint allows Terraform to use version 3.0 of the AWS provider or any subsequent version, including future major releases like 4.x, 5.x, and beyond. It establishes a minimum required version without imposing an upper bound.

Why Incorrect

A. This describes the behavior of the pessimistic constraint operator (~> 3.0), which would allow versions >= 3.0 but < 4.0.
C. The constraint applies to all subsequent versions (major, minor, and patch), not just major releases. The phrasing is imprecise.
D. This is incorrect because the >= operator explicitly includes version 3.0, whereas a > operator would exclude it.

References

1. HashiCorp Terraform Documentation. (n.d.). Provider Requirements - Version Constraints. Terraform by HashiCorp. Retrieved from https://developer.hashicorp.com/terraform/language/providers/requirements#version-constraints

Section: Version Constraints. The documentation table explicitly defines the >= operator: "Allows the specified version and any later version." For the example >= 1.0.0

it states

"Allows version 1.0.0 and any later version." This directly supports answer B. It also defines the ~> operator

confirming why option A is incorrect.

2. HashiCorp Learn. (n.d.). Lock and Upgrade Provider Versions. Terraform by HashiCorp. Retrieved from https://developer.hashicorp.com/terraform/tutorials/configuration-language/provider-versioning

Section: Add provider version constraints. This tutorial explains

"The >= version constraint operator allows you to specify the minimum version of a provider." This confirms that the code sets a minimum version with no maximum.

Scroll to Top