Hi, after upgrading to Terraform 0.14.11 from 0.13.7, I get the following error messages while executing a terraform plan
. In version 0.13.7, this error didn’t appear.
Error: Provider configuration not present
To work with module.qubole-cluster-omega.restapi_object.qubole-cluster (orphan) its original provider configuration at module.qubole-cluster-omega.provider[“Terraform Registry”]
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 module.qubole-cluster-omega.restapi_object.qubole-cluster (orphan), after which you can remove the provider configuration again.
Each of the error messages is related with an existing resource. (For this example I am simplifying with just one resource)
To upgrade to version 0.13.7 I had to execute the following command:
terraform state replace-provider registry.terraform.io/-/restapi registry.terraform.io/fmontezuma/restapi
The structure of my Terraform directories is the following:
→ local-modules
---->qubole-api
--------main.tf
--------default.tpl
--------outputs.tf
--------variables.tf
--------version.tf
→ hde
---->qubole-api-cluster
-------->dev
------------>qubole-clusters.tf
In local-modules/qubole-api/main.tf,
it’s defined:
provider "restapi" {
uri = "https://us.qubole.com/api/v1.3"
headers = {
"X-AUTH-TOKEN" = var.qubole_api_key
"Content-Type" = "application/json",
"Accept" = "application/json",
}
debug = true
write_returns_object = true
}
locals {
qubole-cluster = templatefile("${path.module}/${var.template}.tpl", {
vpc_id = var.vpc_id
aws_region = var.aws_region
role_instance_profile = var.role_instance_profile
[snip]
}
resource "restapi_object" "qubole-cluster" {
path = "/clusters"
debug = true
data = local.qubole-cluster
}
In local-modules/qubole-api/versions.tf
:
terraform {
required_providers {
restapi = {
source = "fmontezuma/restapi"
version = ">=1.9.3"
}
}
}
In hde/qubole-api-cluster/dev/qubole-clusters.tf
:
module "qubole-cluster-omega" {
source = "../../../../local-modules/qubole-api"
environment = "dev"
[snip]
How can I fix this error? Thanks