Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Provider produced inconsistent final plan #472

Open
aravindmetla opened this issue Apr 25, 2024 · 3 comments
Open

Error: Provider produced inconsistent final plan #472

aravindmetla opened this issue Apr 25, 2024 · 3 comments

Comments

@aravindmetla
Copy link

we are using below module to create api connection for sendgrid

terraform {
required_providers {
azapi = {
source = "Azure/azapi"
}
}
required_version = ">= 0.14"
}

resource "azapi_resource" "api_connecton_sengrid" {
type = "Microsoft.Web/connections@2018-07-01-preview"
name = "${var.project_name}-sendgrid"
location = var.location
parent_id = var.parent_id
schema_validation_enabled = false
tags = {
project_name = var.project_name
}

body = jsonencode({
properties = {
api = {
displayName = "SendGrid",
id = "/subscriptions/${var.subscription_id}/providers/Microsoft.Web/locations/${var.location}/managedApis/sendgrid"
}
displayName = "SendGrid",
parameterValues = {
apiKey = "${var.sendgridApiKey}"
},
}
})
}

above module is refered in while creating api connection as below

module "send_grid_api_connection_ais" {
source = "../modules/api_connection/sendGrid"
project_name = "ais"
location = var.location
parent_id = azurerm_resource_group.services.id
subscription_id = var.subscription_id
sendgridApiKey = data.azurerm_key_vault_secret.sendgrid_apikey.value
}

when we do terraform apply we are receiving below error

**Error: Provider produced inconsistent final plan

When expanding the plan for
module.send_grid_api_connection_ais.azapi_resource.api_connecton_sengrid to
include new values learned so far during apply, provider
"registry.terraform.io/azure/azapi" produced an invalid new value for
.removing_special_chars: was cty.False, but now null._

This is a bug in the provider, which should be reported in the provider's own
issue tracker.**

@ms-henglu
Copy link
Collaborator

Hi @aravindmetla ,

Thank you for taking time to report this issue and apologize for the trouble!

Would you please try to run terraform plan command again and see if there's any changes or errors? And would you please also share the terraform version you're using? Thanks

@aravindmetla
Copy link
Author

aravindmetla commented Apr 25, 2024

Using terraform v1.3.5. Plan executed successfully. Fixed issue by pointing the version of azapi to "1.12.1" in the above module.

below is the changelog from terraform plan on the resource send_grid_api_connection_ais

module.send_grid_api_connection_ais.azapi_resource.api_connecton_sengrid will be updated in-place
~ resource "azapi_resource" "api_connecton_sengrid" {
~ body = (sensitive value) -> (sensitive value)
id = "/subscriptions/de4a72fe-316a-4f9c-b37f-c8bcd00a457f/resourceGroups/ais-sit-rg-services/providers/Microsoft.Web/connections/ais-sendgrid"
name = "ais-sendgrid"
~ output = jsonencode({}) -> (known after apply)
+ removing_special_chars = false
tags = {
"project_name" = "ais"
}
# (6 unchanged attributes hidden)
}

@ms-henglu
Copy link
Collaborator

Hi @aravindmetla , thanks for the details.

This issue could be resolved with the latest Terraform. Please try to use the latest Terraform.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants