I would love to understand your reasoning around p...
# terraform
w
I would love to understand your reasoning around provider pinning. I know Hashicorp's recommendations are currently 1. use minimum constraints
>=
for modules 2. use pessimistic semver constraints
~>
for root modules but which of those does an Atmos terraform component fit into? We are building our own components for a brownfields deployment and have based all of our components on the cloudposse example module template which uses the cloudposse test-harness to ensure that provider versions are pinned with only minimum constraints. However, there are cases like https://medium.com/@mr.ryanflynn/why-hard-pinning-terraform-provider-versions-is-essential-a-lesson-from-an-aws-eks-issue-a03928ae410f and recommendations from seasoned terraform users in reddit that suggest versions should always be hard-pinned with
=
. I can also see the test-harness did allow pessimistic semver constraints at some point, I just can't see why it was allowed or why it was changed. We are also exploring the idea of using a component repo as either a component (root module) or a module (eg. an EKS component that includes the generic IAM component as a module to add roles using the cluster's own OIDC provider so we don't have to call the IAM component from atmos a second time)
e
Components are root modules, not child modules.
Components should have strict pinning. How strict is a matter of debate. At a minimum, major and minor pinning.
Is because we were bit pretty severely in the beginning when our pinning in child modules was too strict.
The problem we encountered was that many of our modules refer to other child modules, and it was impossible to run automated tests to test if a newer provider worked, if the child module didn't allow us to use a newer version of the provider.
So, as a general rule, we try to always just do lower bound pinning in our child modules. And then do stricter pinning in our components.
m
with the Component Pinned, but the Providers themselves set to
>=
how do people deal with the case where a provider could have a major version upgrade between the
apply
to a test environment and the
apply
to the related Production Environment a few hours/days/weeks later (once it has been tested/proven in the test environment)?