Terraform modules source using both a ref for branch and tag

4.3k views Asked by At

I am trying to determine if it is possible to specify both a matching branch and a tag when declaring a module in terraforming.

In the Terraform Docs it notes that branch or tag can be used in the source for a module.

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

This works for specifying branch ref=branch-name or tag ref=tag, for my use case I wish to specify the branch as well as a tag simultaneously so that I can reference a module in a particular branch and at a specified version.

I would hope it would have worked something like this

module "vpc" {
  source = "git::https://example.com/vpc.git?ref=refs/heads/branch-name?ref=refs/tags/v1.0.0"
}

This does not work, please tell me if this is possible and if so how.

Thank you ^_^

0

There are 0 answers