Open flobeier opened 2 years ago
Hey @flobeier - it looks like this has been fixed in 3.0 by #14759, if possible could you update to the newest version of the provider and see if this is still an issue?
@katbyte glad to hear that this has already been fixed. I removed my workaround and can confirm that the fix is working as expected.
@katbyte I just encountered this issue again with azurerm provider version 3.1.0
:
Error: Provider produced inconsistent final plan
When expanding the plan for azurerm_mssql_database_vulnerability_assessment_rule_baseline.ignore_missing_additional_users_example1_database to include new values learned so far during apply, provider
"registry.terraform.io/hashicorp/azurerm" produced an invalid new value for .server_vulnerability_assessment_id: was
cty.StringVal("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-example/providers/Microsoft.Sql/servers/example-sqlserver/vulnerabilityAssessments/Default"), but now
cty.StringVal("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-example/providers/Microsoft.Sql/servers/example-sqlserver/vulnerabilityAssessments/default").
This is a bug in the provider, which should be reported in the provider's own issue tracker.
When expanding the plan for azurerm_mssql_database_vulnerability_assessment_rule_baseline.ignore_missing_additional_users_example2_database to include new values learned so far during apply, provider
"registry.terraform.io/hashicorp/azurerm" produced an invalid new value for .server_vulnerability_assessment_id: was
cty.StringVal("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-example/providers/Microsoft.Sql/servers/example-sqlserver/vulnerabilityAssessments/Default"), but now
cty.StringVal("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-example/providers/Microsoft.Sql/servers/example-sqlserver/vulnerabilityAssessments/default").
This is a bug in the provider, which should be reported in the provider's own issue tracker.
During the first terraform apply
I got the errors above, during the second I got no errors.
Edit: Since this happened exactly the same in two environments, I think I now know what happens: When the vulnerability assessment is updated during the same terraform apply
run in which the baseline rules are going to be created, the inconsistent final plan error appears.
Community Note
Terraform (and AzureRM Provider) Version
Affected Resource(s)
azurerm_mssql_database_vulnerability_assessment_rule_baseline
Terraform Configuration Files
Expected Behaviour
Terraform should be able to deploy two baselines without running into an error.
Actual Behaviour
Terraform tried to deploy the two baselines simultaneously after the vulnerability assessment they belong to was created, with one failing because of an inconsistent final plan (missing root element).
Steps to Reproduce
terraform apply
with two azurerm_mssql_database_vulnerability_assessment_rule_baseline resources. A few tries might be needed to trigger the issue, so far I just encountered it once.