Error: Provider configuration not present (provider aws.kms)

Getting this error while running “terraform validate”. I’ve upgraded to 0.12, and ran “terraform init” without any problem.
Error: Provider configuration not present

To work with aws_kms_alias.self its original provider
configuration at provider.aws.kms is required, but it
has been removed. This occurs when a provider configuration is removed while
objects created by that provider still exist in the state. Re-add the provider
configuration to destroy aws_kms_alias.self, after which
you can remove the provider configuration again.

To work with aws_kms_key.self its original provider
configuration at provider.aws.kms is required, but it
has been removed. This occurs when a provider configuration is removed while
objects created by that provider still exist in the state. Re-add the provider
configuration to destroy aws_kms_key.self, after which
you can remove the provider configuration again.

Not knowing too much about what the problem is, you can try:

terraform init -upgrade

This error arises when there’s an object in the latest Terraform state that is no longer in the configuration but Terraform can’t destroy it (as would normally be expected) because the provider configuration for doing so also isn’t present.

This should arise only if you’ve recently removed resource "aws_kms_alias" "self" along with the provider "aws" block that had alias = "kms" set in it. If so, to proceed you’ll need to temporarily restore that provider "aws" block, run terraform apply to have Terraform destroy resource "aws_kms_alias" "self", and then you can remove the provider "aws" block with alias = "kms" because it’ll no longer be needed.