-
Notifications
You must be signed in to change notification settings - Fork 9.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request: Module versioning for git sources #17994
Comments
Would love this feature. |
@jgiles does a single version work today, e.g.
? Or would that need to be done via
|
Also looking forward to something like this, though I'd personally prefer interpolation for the entire source parameter rather than just separating the version/ref. |
We're successfully using the ref + release functionality with Github sources today, it just seems a little kludgy that it works one way for Terraform registry and another way for Github, when they're both effectively providing similar functionality. |
@rarkins I believe you need to do the We actually have a hacky mechanism where all our TF repo release tags are like |
@jgiles thanks for the follow-up details. I added Terraform version upgrading to Renovate Bot just a couple of days ago actually, using the logic to look for semver-like ref tags like you mention. It would also work with your "hack" tags with one small config change, however an automated approach would save you from manual search/replace so you could do away with the hack instead if you preferred. |
any chance to see this in future releases? |
I guess there is conflict of interest with Terraform Enterprise's private module registry, which is paid product. |
Looks like Terraform 0.12 broke the git |
The If you were using something like
If you place it on the end, Terraform understands it instead as an attempt to use a branch called If the above doesn't explain a change in behavior you've seen, please open a new issue for it... there were no other changes intended here, so if there have been other regressions then we'll get them fixed up, but best to keep bug reports separate from feature requests so that we can track and prioritize them better. |
@apparentlymart that was exactly the issue I was facing and I thought it was something related to specifying a |
Any chance we can get this feature? So that we can use the expressions ( |
I wrote about how we handled this situation at DAZN https://medium.com/dazn-tech/terraform-module-versioning-for-git-sources-5a792ceb74d7 Basically we use our CI (Github Action) to override major and minor tags, so that we can specify those directly, for example: module "ecs-service" {
source = "github.com/getndazn/terraform-module-ecs?ref=v1" Bit hacky but solves the problem! |
@stephanebruckert That doesn't provide the semver constraint, just pins to a specific ref. I understand that to mean the inclusion of a comparator.
|
You are right that solution doesn't handle operations, it's more of a quick win to profit from majors and minors. |
This request is a follow-up to #15613, which was closed after versioning was added for module registry modules.
It would be extremely useful to use semver constraints on modules across our terraform codebase:
This would save users from widespread source code updates just to pick up patch fixes.
The text was updated successfully, but these errors were encountered: