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

postgresql_server: change sku_name tier: error: InvalidUpgradeEdition #7131

Closed
thomas-riccardi opened this issue May 29, 2020 · 4 comments
Closed

Comments

@thomas-riccardi
Copy link

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

Terraform (and AzureRM Provider) Version

Terraform v0.12.25
+ provider.azurerm v2.9.0

Affected Resource(s)

  • azurerm_postgresql_server

Terraform Configuration Files

Terraform will perform the following actions:

  # azurerm_postgresql_server.vesta will be updated in-place
  ~ resource "azurerm_postgresql_server" "xxx" {
        administrator_login               = "xxx"
        administrator_login_password      = (sensitive value)
        auto_grow_enabled                 = true
        backup_retention_days             = 7
        create_mode                       = "Default"
        fqdn                              = "xxx.postgres.database.azure.com"
        geo_redundant_backup_enabled      = false
        id                                = "/subscriptions/xxx/resourceGroups/xxx/providers/Microsoft.DBforPostgreSQL/servers/xxx"
        infrastructure_encryption_enabled = false
        location                          = "westeurope"
        name                              = "xxx"
        public_network_access_enabled     = true
        resource_group_name               = "xxx"
      ~ sku_name                          = "B_Gen5_1" -> "GP_Gen5_4"
        ssl_enforcement                   = "Enabled"
        ssl_enforcement_enabled           = true
        ssl_minimal_tls_version_enforced  = "TLSEnforcementDisabled"
        storage_mb                        = 512000
        tags                              = {}
        version                           = "11"

        storage_profile {
            auto_grow             = "Enabled"
            backup_retention_days = 7
            geo_redundant_backup  = "Disabled"
            storage_mb            = 512000
        }
    }

Expected Behavior

Successfully update the SKU.

It doesn't seem to be possible to update the tier (aka edition) (indeed in the portal it's not doable), so probably the provider should plan to delete and re-create the database server resource.

Actual Behavior

Error: updating PostgreSQL Server "foo" (Resource Group "foo"): postgresql.ServersClient#Update: Failure sending request: StatusCode=400 -- Original Error: Code="InvalidUpgradeEdition" Message="The edition 'GeneralPurpose' is not a valid edition. Edition cannot be changed by update."

  on resources.tf line 21, in resource "azurerm_postgresql_server" "foo":
  21: resource "azurerm_postgresql_server" "foo" {

Steps to Reproduce

  1. terraform apply with sku B_*
  2. terraform apply with sku GP_*
@katbyte katbyte added this to the v2.16.0 milestone Jun 24, 2020
katbyte pushed a commit that referenced this issue Jun 24, 2020
…7456)

Fix :#7131

=== RUN TestAccAzureRMPostgreSQLServer_updateSKU
=== PAUSE TestAccAzureRMPostgreSQLServer_updateSKU
=== CONT TestAccAzureRMPostgreSQLServer_updateSKU
--- PASS: TestAccAzureRMPostgreSQLServer_updateSKU (632.60s)
PASS
@tombuildsstuff
Copy link
Member

Fixed via #7456

@thomas-riccardi
Copy link
Author

@tombuildsstuff thanks!

According to https://techcommunity.microsoft.com/t5/azure-database-for-mysql/upgrade-from-basic-to-general-purpose-or-memory-optimized-tiers/ba-p/830404 there seems to be the same issue for mysql servers, and possibly for other services too (I don't know azure well enough). It may be a good idea to try to fix them all.

@ghost
Copy link

ghost commented Jun 25, 2020

This has been released in version 2.16.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.16.0"
}
# ... other configuration ...

jrauschenbusch pushed a commit to jrauschenbusch/terraform-provider-azurerm that referenced this issue Jun 29, 2020
…ashicorp#7456)

Fix :hashicorp#7131

=== RUN TestAccAzureRMPostgreSQLServer_updateSKU
=== PAUSE TestAccAzureRMPostgreSQLServer_updateSKU
=== CONT TestAccAzureRMPostgreSQLServer_updateSKU
--- PASS: TestAccAzureRMPostgreSQLServer_updateSKU (632.60s)
PASS
jrauschenbusch pushed a commit to jrauschenbusch/terraform-provider-azurerm that referenced this issue Jun 29, 2020
…ashicorp#7456)

Fix :hashicorp#7131

=== RUN TestAccAzureRMPostgreSQLServer_updateSKU
=== PAUSE TestAccAzureRMPostgreSQLServer_updateSKU
=== CONT TestAccAzureRMPostgreSQLServer_updateSKU
--- PASS: TestAccAzureRMPostgreSQLServer_updateSKU (632.60s)
PASS
@ghost
Copy link

ghost commented Jul 25, 2020

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 👉 hashibot-feedback@hashicorp.com. Thanks!

@hashicorp hashicorp locked and limited conversation to collaborators Jul 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants