Changing required privider version (e.g. downgrading aws = 3.57.0 to 3.52.0 but also upgrading version) return this error running terraspace:
Error: Provider requirements cannot be satisfied by locked dependencies
The following required providers are not installed:
- registry.terraform.io/hashicorp/aws (3.52.0)
Terraform reinitialization required detected. Will run `terraform init` and try again.
=> terraform init -get -input=false >> /tmp/terraspace/log/init/...log
Error: Failed to query available provider packages
Could not retrieve the list of available versions for provider hashicorp/aws:
locked provider registry.terraform.io/hashicorp/aws 3.57.0 does not match
Terraform reinitialization required detected. Will run `terraform init` and try again.
=> terraform init -get -input=false >> /tmp/terraspace/log/init/...log
We cannot remove this error also removing .terraform.lock.hcl form terraspace cache stack directory or using:
terraspace clean all
As terraspace save somewhere lock file provider information and reuse on next run.
The only workaround we found was this:
cd .terraspace-cache/{region}/{env}/stacks/{stack_name}/
vim terraform.tf -> set as versioni in terraform.tf you need (normally that on code in git)
terraform init -upgrade
rm -rf .terraform/
How can terraspace reintroduce error after terraspace clean all ?
There is a planning to support “-upgrade” for terraspace to avoid manual changes ?
Thank you