Open ghost opened 1 year ago
We have this error very often and I just ran into it today again. So, any plans to fix this at some point?
It seems that the state is erroneously updated despite the Azure APIM API actually returned an error and so the API got actually not updated. This behavior is very very unintuitive because the second time the config just applies with "No changes".
In additional the fact that the actual error mess is just cut off by Terraform makes troubleshooting also unscary difficult. Normally in the error message the reason why the api definition is invalid is shown. But this very relevant part of the error message gets just cut off by terraform/azurerm.
@wuxu92 Just saw your PR: https://github.com/hashicorp/go-azure-sdk/pull/1090
Not sure if this would fix also this issue. But I assume not entirely. Because in this case we get the error message but somehow the state is updated despite the error and the interesting part of the error is also chopped in the screenshots of your PR.
So, I assume this issue here need some other/additional fix. Or what do you think?
Thx!
Is there an existing issue for this?
Community Note
Terraform Version
1.4.6
AzureRM Provider Version
3.59
Affected Resource(s)/Data Source(s)
azurerm_api_management_api
Terraform Configuration Files
swagger1.json
file:swagger2
file:Manifests:
Debug Output/Panic Output
Deploy the API with
swagger1.json
for the first time: OKDeploy the API with
swagger2.json
for the first time:Deploy the API with
swagger2.json
for the second time: OKExpected Behaviour
When applying the manifests with
swagger2.json
for the second time, I expect to have the same error as when applying for the first time.Actual Behaviour
Actually, when applying the manifests with
swagger2.json
for the second time, there is no error.However, the error is present when using
az
to deploy theswagger2.json
for the second time (as expected):Result:
Steps to Reproduce
terraform apply -var swagger_file=swagger1.json
# OKterraform apply -var swagger_file=swagger2.json
# Get an error (because we are modifying an existing operationId)terraform apply -var swagger_file=swagger2.json
# OKImportant Factoids
No response
References
No response