Looking at the terragrunt cli/download_source_test.go
source code, there is no apparent way to specify a branch.
That means you need to add a tag to that branch, and use that tag as ref
.
That being said, check first if ref=<mybranch>
works.
However, the OP potatopotato confirms in the comments that referencing the branch name directly does not work.
I just made changes on branch, and:
git add
git commit
git tag -a 'v1.branch'
git push --follow-tags -u origin <branch_name>
and I could use the tag reference to the branch, not master
.
And German Dautin's answer points to Terraform / Module Sources / Selecting a Revision.
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.
So using a branch name is possible.