nerdexam
HashiCorp

TERRAFORM-ASSOCIATE-003 · 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…

Interact 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

(22 responses)
  • A
    68% (15)
  • B
    23% (5)
  • C
    9% (2)

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 versioning#Git module source#source path arguments#module registry

Community Discussion

No community discussion yet for this question.

Full TERRAFORM-ASSOCIATE-003 Practice