Skip to content
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

use minimum versions for provider pinning #25

Merged
merged 3 commits into from
Sep 12, 2020
Merged

Conversation

woz5999
Copy link
Contributor

@woz5999 woz5999 commented Sep 2, 2020

what

set minimum versions for providers without pinning to a specific major version

why

the current method makes it very difficult to maintain or upgrade consistent provider versions within a project

references

https://www.terraform.io/docs/configuration/provider-requirements.html#best-practices-for-provider-versions

@woz5999 woz5999 requested a review from a team as a code owner September 2, 2020 17:14
@woz5999 woz5999 requested review from jhosteny and RothAndrew and removed request for a team September 2, 2020 17:14
@scream314
Copy link

Hey @woz5999 !

Thank you for your PR. I think I have the same issue as you do. My problem is with your PR that it would introduce the same problem but in reverse. In case of breaking changes in v4, you might need to pin the version back...

@woz5999
Copy link
Contributor Author

woz5999 commented Sep 3, 2020

@scream314 This scenario is anticipated and covered by the official best practice recommended by HashiCorp in the link in the description.

Do not use ~> (or other maximum-version constraints) for modules you intend to reuse across many configurations, even if you know the module isn't compatible with certain newer versions. Doing so can sometimes prevent errors, but more often it forces users of the module to update many modules simultaneously when performing routine upgrades. Specify a minimum version, document any known incompatibilities, and let the root module manage the maximum version.

https://www.terraform.io/docs/configuration/provider-requirements.html#best-practices-for-provider-versions

@woz5999
Copy link
Contributor Author

woz5999 commented Sep 3, 2020

@aknysh

@woz5999
Copy link
Contributor Author

woz5999 commented Sep 9, 2020

@osterman

osterman
osterman previously approved these changes Sep 10, 2020
@osterman
Copy link
Member

/test all

@Nuru Nuru added the patch A minor, backward compatible change label Sep 12, 2020
@Nuru
Copy link

Nuru commented Sep 12, 2020

/test all

@Nuru Nuru merged commit 9879fae into cloudposse:master Sep 12, 2020
@osterman
Copy link
Member

Thanks @woz5999 for linking to that official best practice! We've learned this lesson the hard way. Will incorporate this into our own best practices.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
patch A minor, backward compatible change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants