nerdexam
HashiCorp

TERRAFORM-ASSOCIATE-004 · Question #72

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)?

The correct answer is A. Append pref=v1.0.0 argument to the source path. The best way to specify a tag of v1.0.0 when referencing a module stored in Git is to append ?ref=v1.0.0 argument to the source path. This tells Terraform to use a specific Git example, source = "git::https://example.com/vpc.git?ref=v1.0.0". This ensures that the module version…

Submitted by olafpl· Apr 18, 2026Work with Terraform Modules

Question

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)?

Options

  • AAppend pref=v1.0.0 argument to the source path
  • BAdd version = "1.0.0" parameter to module block
  • CNothing modules stored on GitHub always default to version 1.0.0

How the community answered

(37 responses)
  • A
    89% (33)
  • B
    8% (3)
  • C
    3% (1)

Explanation

The best way to specify a tag of v1.0.0 when referencing a module stored in Git is to append ?ref=v1.0.0 argument to the source path. This tells Terraform to use a specific Git example, source = "git::https://example.com/vpc.git?ref=v1.0.0". This ensures that the module version is consistent and reproducible across different environments.

Topics

#Module Source Syntax#Git Modules#Module Versioning

Community Discussion

No community discussion yet for this question.

Full TERRAFORM-ASSOCIATE-004 Practice