Exam Terraform Associate All QuestionsBrowse all questions from this exam
Question 165

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

    Correct Answer: A

    When referencing a module stored in Git, the correct way to specify a tag such as v1.0.0 is by appending the ?ref=v1.0.0 argument to the source path. This tells the system to use the specific tag or version of the module from the Git repository.

Discussion
RVivekOption: A

If the source is from terrform registry then we can use version = "1.0.0" when using git as the source we have to use ?ref=1.0.0 the exact git path givin in the question is given in this terraform official documentation please check https://www.terraform.io/language/modules/sources#selecting-a-revision

BaburTurkOption: A

example source = "git::https://example.com/vpc.git?ref=v1.2.0"

dinesh198728Option: A

A is correct

donathonOption: A

https://www.terraform.io/language/modules/sources#selecting-a-revision

BurakkoOption: B

Use the version argument in the module block to specify versions: Example: module "consul" { source = "hashicorp/consul/aws" version = "0.0.5" servers = 3 }

Linus11

This is about version stored in GIT, not in consul.

zyxphreezOption: A

as Donathon said.... https://www.terraform.io/language/modules/sources#selecting-a-revision please check the module repository is GIT.... Burakko answer is incorrect

Burakko

There was exactly the same question earlier. This was the answer. however if you I ask me, both answers must be correct. Because they both work.