-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
azurerm_cosmosdb_account with zone_redundant = true errors on minor updates (e.g. change tags) #9463
Comments
Attempting to debug this further, I wonder if the issue is that "PUT" request contains |
I've not done any Go development but I wonder if it might be that oldLocations doesn't seem to read the Zone Redundancy setting https://github.com/terraform-providers/terraform-provider-azurerm/blob/master/azurerm/internal/services/cosmos/cosmosdb_account_resource.go#L499-L502 which is then passed in at L526 ? |
I'm trying to fix it in my fork, but it's difficult to test :( |
MR is here #9485 |
Thanks kvendingoldo. That's quick work! |
This has been released in version 2.38.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example: provider "azurerm" {
version = "~> 2.38.0"
}
# ... other configuration ... |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks! |
Community Note
Terraform (and AzureRM Provider) Version
Terraform v0.13.5
Affected Resource(s)
Terraform Configuration Files
Debug Output
https://gist.github.com/mnjhey/01ac1b8b629cd26f0bd6280ae634265e
Panic Output
Expected Behaviour
The value of the "Role" tag should have been changed to "ChangedToNewValue". This does not error if you update the tag value through the console.
Actual Behaviour
Looking at the debug log, Terraform is calling a PUT against
/subscriptions/cc40dd1c-a034-4332-b88b-40d9131cb5db/resourceGroups/rg-debug/providers/Microsoft.DocumentDB/databaseAccounts/mn-cosmos-debug?api-version=2020-04-01
with{"kind":"MongoDB","location":"westeurope","properties":{"consistencyPolicy":{"defaultConsistencyLevel":"BoundedStaleness","maxStalenessPrefix":100000,"maxIntervalInSeconds":300},"locations":[{"failoverPriority":0,"locationName":"West Europe"}],"databaseAccountOfferType":"Standard","ipRules":[],"isVirtualNetworkFilterEnabled":false,"enableAutomaticFailover":false,"capabilities":[{"name":"EnableMongo"}],"virtualNetworkRules":[],"enableMultipleWriteLocations":false,"publicNetworkAccess":"Enabled","enableFreeTier":false},"tags":{"Project":"DebugProject","Role":"ChangedToNewValue1"}}
This returns a 400 error with {"code":"BadRequest","message":"Zone redundancy cannot be changed for existing region West Europe. Please remove and re add the region, to change Zone redundancy on the region.\r\nActivityId: a1fd9772-1c32-40a4-b972-4923a234a4aa, Microsoft.Azure.Documents.Common/2.11.0"}
The non-debug Terraform error is.
Steps to Reproduce
terraform apply
terraform apply
Important Factoids
References
The text was updated successfully, but these errors were encountered: