TERRAFORM-ASSOCIATE-004 · Question #243
Which of the following should you add in the required_providers block to define a provider version constraint?
The correct answer is B. version = "3.1". In the required_providers block, provider version constraints follow standard HCL attribute syntax: an attribute name, an equals sign, and a quoted string value - for example, version = "3.1". A bare version keyword without a value (A), a colon separator like version: 3.1 (C)…
Question
Options
- Aversion
- Bversion = "3.1"
- Cversion: 3.1
- Dversion - 3.1
How the community answered
(22 responses)- A5% (1)
- B91% (20)
- D5% (1)
Explanation
In the required_providers block, provider version constraints follow standard HCL attribute syntax: an attribute name, an equals sign, and a quoted string value - for example, version = "3.1". A bare version keyword without a value (A), a colon separator like version: 3.1 (C), and a dash separator like version - 3.1 (D) are all invalid HCL syntax and will cause a parsing error when Terraform initializes.
Topics
Community Discussion
No community discussion yet for this question.