Introduction :-
Sometimes user gets below error during their terraform apply phase :-
Error: missing or corrupted provider plugins: │ - registry.terraform.io/hashicorp/aws: there is no package for registry.terraform.io/hashicorp/aws 5.29.0 cached in .terraform/providers
Solution :-
In Terraform v1.0 and earlier, terraform init does not automatically remove now-unneeded providers from the lock file, and instead just ignores them.
- If you removed a provider dependency while using an earlier version of Terraform and then upgraded to Terraform v1.1 or later than you may see the error "missing or corrupted provider plugins", referring to the stale lock file entries.
- If so, run terraform init or terraform init -upgrade with the new Terraform version to tidy those unneeded entries and then retry the previous operation.
Additional Information :-
If the above solution does not help, please open a ticket with the Terraform Cloud support team:- https://support.hashicorp.com/hc/en-us/requests/new