atmos
atmos copied to clipboard
Stale providers in a `.terraform.lock.hcl` file can cause issues
Found a bug? Maybe our Slack Community can help.
Describe the Bug
Sometimes old providers are cached in a .terraform.lock.hcl file and need to be manually removed to allow upgrading modules.
It would be nice to have an atmos.yaml setting to remove a component's .terraform.lock.hcl (without running a full clean) prior to running a terraform init. So if this setting was enabled, and a plan/deploy/apply was run, it would first remove the lock file, then run the init, and then the desired command.
or just always run terraform init -upgrade
We will solve this with atmos clean all see #272. I don't think this should happen automatically, or if it does, it would need to be a stack-level setting. It's not a "best practice" to remove the file (or the file wouldn't exist).
Upgrading every time automatically will lead to unpredictable behavior. That too should be a stack level setting, if anything.