nerdexam
HashiCorp

TA-002-P · Question #154

While using generic git repository as a module source, which of the below options allows terraform to select a specific version or tag instead of selecting the HEAD.

The correct answer is A. Append ref argument as. By default, Terraform will clone and use the default branch (referenced by HEAD) in the selected repository. You can override this using the ref argument: source = "git::https://example.com/vpc.git?ref=v1.2.0" The value of the ref argument can be any reference that would be…

Interact with Terraform modules

Question

While using generic git repository as a module source, which of the below options allows terraform to select a specific version or tag instead of selecting the HEAD.

Options

  • AAppend ref argument as
  • BAppend version argument as
  • CAppend ref argument as
  • DBy default, Terraform will clone and use the default branch (referenced by HEAD) in the

How the community answered

(37 responses)
  • A
    95% (35)
  • C
    3% (1)
  • D
    3% (1)

Explanation

By default, Terraform will clone and use the default branch (referenced by HEAD) in the selected repository. You can override this using the ref argument: source = "git::https://example.com/vpc.git?ref=v1.2.0" The value of the ref argument can be any reference that would be accepted by the git checkout command, including branch and tag names.

Topics

#Terraform modules#Module sources#Git modules#Module versioning

Community Discussion

No community discussion yet for this question.

Full TA-002-P Practice