HashiCorp Certified: Terraform Associate — Question 297
Which is the best way to specify a tag of v1.0.0 when referencing a module stored in Git (for example git::https://example.com/vpc.git)?
Answer options
- A. Append ?ref=v1. 0. 0 argument to the source path
- B. Add version = "1.0.0" parameter to module block
- C. Nothing ג€" modules stored on GitHub always default to version 1.0.0
- D. Modules stored on GitHub do not support versioning
Correct answer: A
Explanation
The correct answer is A because appending ?ref=v1.0.0 to the source path explicitly specifies the version of the module being referenced. Option B is incorrect as it does not apply to Git sources, while C is false since GitHub does not default to version 1.0.0 unless specified. Option D is also incorrect because GitHub does support versioning through tags.