Notifications
Clear all
Topic starter
16/07/2022 3:46 pm
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.
- A . Append ref argument as module "vpc" { source = "git:: https://example.com/vpc.git?ref=v1.2.0"}
- B . Append version argument as module "vpc" { source = "git:: https://example.com/vpc.git?version=v1.2.0"}
- C . Append ref argument as module "vpc" { source = "git:: https://example.com/vpc.git#ref=v1.2.0"}
- D . By default, Terraform will clone and use the default branch (referenced by HEAD) in the selected repository and you can not override this.
Suggested Answer: A
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: module "vpc" {
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. https://www.terraform.io/docs/modules/sources.html
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: module "vpc" {
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. https://www.terraform.io/docs/modules/sources.html