-
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_postgresql_flexible_server_database collaction valiation error #22936
Comments
Thanks for raising this issue. I assume it's expected behavior since "de_DE.utf8" is valid value. Suggest to update it to "de_DE.utf8" in tf config. Thanks. Doc Reference: https://www.postgresql.org/docs/current/collation.html |
You are right, that "de_DE.utf8" is indeed the correct value. However, the older provider version also allowed "de_DE.UTF8" and that's what I have used to deploy the infrastructure. If I update the value to lower case, terraform will try to replace the resource because it thinks the collation changes. # azurerm_postgresql_flexible_server_database.example must be replaced
-/+ resource "azurerm_postgresql_flexible_server_database" "example" {
~ collation = "de_DE.UTF8" -> "de_DE.utf8" # forces replacement
~ id = "/subscriptions/XXX/resourceGroups/XXX/providers/Microsoft.DBforPostgreSQL/flexibleServers/XXX/databases/XXX" -> (known after apply)
name = "example"
# (2 unchanged attributes hidden)
} Since we are talking about a database resource here, I can't just do that. |
I am sorry, but Is using lifecycle ignore_changes the only fix for this? |
@tombuildsstuff terraform plan outout: Installed hashicorp/azurerm v3.71.0 (signed by HashiCorp) |
I can reproduce this with The database exists with the collation
Internally, the PostgreSQL engine uses the lower-case
As an attempted unsuccessful workaround I tried to create an upper-case copy of that collation
but that didn't help either. The provider validates the collation name on its own without checking which collations actually do exist in the |
@tadeusz-delphai Did you manage to update version without recreating the database? thanks |
@thomeu No change in behavior since the collation name validator was changed in 3.69.0. The upper-case collation name For now, I just pin a lower version of the azurerm provider. |
I have also ran into this issue with 3.96.0 when migrating from 3.65.0. In our situation, we can't move to another clean DB. I have also tried using the ignore_changes setting without any luck, so I am checking for any advice on how to move forward in ignoring this setting as we have other components we are trying to fix with the later version of Terraform, so we are stuck in a pickle. collation = "en_US.UTF8" lifecycle { |
I have also done the following actions and have yet to be successful.
|
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. |
Is there an existing issue for this?
Community Note
Terraform Version
1.5.4
AzureRM Provider Version
3.69.0
Affected Resource(s)/Data Source(s)
azurerm_postgresql_flexible_server_database
Terraform Configuration Files
Debug Output/Panic Output
Expected Behaviour
The provider version
3.68.0
allowed the collationde_DE.UTF8
, but after upgrading to3.69.0
a validation error occurs.Updating the collation to
de_DE.utf8
fixes the validation error, but forces a replacement on the resource, which is not a viable thing to do for a database.The provider should accept the collation
de_DE.UTF8
to be backwards compatible.Actual Behaviour
Provider does not accept collation
de_DE.UTF8
.Steps to Reproduce
terraform validate
--> validation errorde_DE.UTF8
withde_DE.utf8
in the configurationterraform plan
--> shows force replacement on database resourceImportant Factoids
No response
References
There seem to be more people with similar issues, after the validation got changed. #22689
The text was updated successfully, but these errors were encountered: