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

azurerm_postgresql_database collation English_United Kingdom.1252 isn't listed as an accepted value #23167

Closed
1 task done
grug opened this issue Sep 4, 2023 · 2 comments · Fixed by #23171
Closed
1 task done

Comments

@grug
Copy link

grug commented Sep 4, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment and review the contribution guide to help.

Terraform Version

1.3.6

AzureRM Provider Version

3.71.0

Affected Resource(s)/Data Source(s)

azurerm_postgresql_database

Terraform Configuration Files

terraform {
  required_version = ">= 1.3.6"

  required_providers {
    # Hard-coded version because of problem with app service slot replacement
    azurerm = {
      source  = "hashicorp/azurerm"
      version = "3.71.0"
    }
  }
}

provider "azurerm" {
  features {
    template_deployment {
      delete_nested_items_during_deletion = false
    }
  }
}

resource "azurerm_postgresql_database" "foo" {
  name                = "foo"
  resource_group_name = azurerm_resource_group.main.name
  server_name         = azurerm_postgresql_server.main.name
  charset             = "UTF8"
  collation           = "English_United Kingdom.1252"
}

resource "azurerm_postgresql_server" "main" {
  name                = local.pwdata_sql_servername
  location            = var.location
  resource_group_name = azurerm_resource_group.main.name

  sku_name = var.postgresql_server_sku_name

  storage_mb                   = var.postgresql_server_storage_mb
  backup_retention_days        = var.postgresql_server_backup_retention_days
  geo_redundant_backup_enabled = var.postgresql_server_geo_redundant_backup_enabled
  auto_grow_enabled            = true

  administrator_login              = var.postgresql_server_administrator_login
  administrator_login_password     = var.postgresql_server_administrator_login_password
  version                          = var.postgresql_server_version
  ssl_enforcement_enabled          = var.postgresql_server_ssl_enforcement_enabled
  ssl_minimal_tls_version_enforced = "TLS1_2"
  public_network_access_enabled    = true

  lifecycle {
    ignore_changes = [
      storage_mb
    ]
  }

Debug Output/Panic Output

Error: the value "English_United Kingdom.1252" is not valid for the field "collation", expected either:
│ 
│ * A language code (e.g. 'de', 'en' or 'ja')
│ * A language code and locale with a dash (e.g. 'de-DE', 'en-GB' or 'ja-JP')
│ * A language code and locale with an underscore (e.g. 'de_DE', 'en_GB' or 'ja_JP')
│ * One of the following values: ".utf8", "C", "POSIX", "English_United States.1252", "ucs_basic", "default"
│ 
│ This value can optionally end in '.utf8'
│ 
│ but got "English_United Kingdom.1252"
│ 
│ 
│   with azurerm_postgresql_database.foo,
│   on pg_main.tf line 54, in resource "azurerm_postgresql_database" "foo":
│   54:   collation           = "English_United Kingdom.1252"

Expected Behaviour

It should accept the value English_United Kingdom.1252

Actual Behaviour

I get the error message from above

Steps to Reproduce

  1. Set up your DB as per the terraform above
  2. Plan and apply
  3. Observe the error

If you create the DB using an older version of the provider, it will work and if you import the resource locally and look in the state file, you'll see that it's showing as English_United Kingdom.1252 in the state file.

Important Factoids

No response

References

No response

@grug
Copy link
Author

grug commented Sep 5, 2023

@tombuildsstuff just wanted to say thank you so much for getting the fix merged in. It's super appreciated :)

Copy link

github-actions bot commented May 7, 2024

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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
2 participants