Notifications
Clear all
Topic starter
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
Posted : 02/02/2023 3:18 pm