Skip to content

azurerm_postgresql_flexible_server: force new when downgrading storage_mb#29309

Merged
catriona-m merged 4 commits intohashicorp:mainfrom
wuxu92:pg/downgrade-storage-recreate-28942
Apr 24, 2025
Merged

azurerm_postgresql_flexible_server: force new when downgrading storage_mb#29309
catriona-m merged 4 commits intohashicorp:mainfrom
wuxu92:pg/downgrade-storage-recreate-28942

Conversation

@wuxu92
Copy link
Collaborator

@wuxu92 wuxu92 commented Apr 10, 2025

Community Note

  • Please vote on this PR by adding a 👍 reaction to the original PR to help the community and maintainers prioritize for review
  • Please do not leave comments along the lines of "+1", "me too" or "any updates", they generate extra noise for PR followers and do not help prioritize for review

Description

We should tag the resource force new rather than raising an error. fixes #28942

related links: #25986

Testing

  • My submission includes Test coverage as described in the Contribution Guide and the tests pass. (if this is not possible for any reason, please include details of why you did or could not add test coverage)
Terraform will perform the following actions:

  # azurerm_postgresql_flexible_server.test must be replaced
-/+ resource "azurerm_postgresql_flexible_server" "test" {
      - administrator_password_wo_version = 0 -> null
      ~ backup_retention_days             = 7 -> (known after apply)
      ~ fqdn                              = "xuwu1-pg1.postgres.database.azure.com" -> (known after apply)
      ~ id                                = "/subscriptions/xxx/resourceGroups/RG-xuwu1-Case/providers/Microsoft.DBforPostgreSQL/flexibleServers/xuwu1-pg1" -> (known after apply)
      ~ name                              = "xuwu1-pg1" -> "xuwu1-pg2" # forces replacement
      + private_dns_zone_id               = (known after apply)
      ~ storage_mb                        = 131072 -> 65536 # forces replacement
      ~ storage_tier                      = "P10" -> (known after apply)
      - tags                              = {} -> null
        # (13 unchanged attributes hidden)

      ~ authentication (known after apply)
      - authentication {
          - active_directory_auth_enabled = false -> null
          - password_auth_enabled         = true -> null
            # (1 unchanged attribute hidden)
        }
    }

Plan: 1 to add, 0 to change, 1 to destroy.
....
azurerm_postgresql_flexible_server.test: Still creating... [4m0s elapsed]
azurerm_postgresql_flexible_server.test: Creation complete after 4m8s [id=/subscriptions/xxx/resourceGroups/RG-xuwu1-Case/providers/Microsoft.DBforPostgreSQL/flexibleServers/xuwu1-pg2]

Apply complete! Resources: 1 added, 0 changed, 1 destroyed.

Change Log

Below please provide what should go into the changelog (if anything) conforming to the Changelog Format documented here.

This is a (please select all that apply):

  • Bug Fix
  • New Feature (ie adding a service, resource, or data source)
  • Enhancement
  • Breaking Change

Related Issue(s)

Fixes #28942

Note

If this PR changes meaningfully during the course of review please update the title and description as required.

Copy link
Member

@catriona-m catriona-m left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @wuxu92 LGTM!

@catriona-m catriona-m merged commit 7a055a5 into hashicorp:main Apr 24, 2025
33 checks passed
@github-actions github-actions bot added this to the v4.27.0 milestone Apr 24, 2025
catriona-m added a commit that referenced this pull request Apr 24, 2025
jackofallops added a commit that referenced this pull request Apr 25, 2025
* Update CHANGELOG.md #29285, #29294

* Update CHANGELOG.md for #29307

* Update CHANGELOG.md #29283

* Update CHANGELOG.md #29271

* Update CHANGELOG.md #29298

* Update CHANGELOG.md #29278

* Update CHANGELOG.md #29341

* Update CHANGELOG.md #29328

* Update CHANGELOG.md #29292

* Update CHANGELOG.md #29361

* Update CHANGELOG.md #29296

* Update CHANGELOG.md #28239

* Update CHANGELOG.md #28974

* Update CHANGELOG.md #29254

* Update CHANGELOG.md #29333

* Update CHANGELOG.md #29314

* Update CHANGELOG.md #28929

* Update CHANGELOG.md for #29382

* Update for #28676

* Update CHANGELOG.md for #28740

* Update CHANGELOG.md for #28559

* Update CHANGELOG.md #29143

* Update CHANGELOG.md #29329

* Update CHANGELOG.md #29380

* Update CHANGELOG.md #29309

* Update CHANGELOG.md #29317

* prep for release

---------

Co-authored-by: Matthew Frahry <mbfrahry@gmail.com>
Co-authored-by: catriona-m <86247157+catriona-m@users.noreply.github.com>
Co-authored-by: kt <kt@katbyte.me>
Co-authored-by: stephybun <steph@hashicorp.com>
Co-authored-by: jackofallops <ste@hashicorp.com>
teowa pushed a commit to teowa/terraform-provider-azurerm that referenced this pull request May 8, 2025
…rage_mb` (hashicorp#29309)

* downgrade storage of pg server should trigger a forcenew

* remove unnecessary check in create/update

* remove scale down storage acc test

* remove unused test function
teowa pushed a commit to teowa/terraform-provider-azurerm that referenced this pull request May 8, 2025
* Update CHANGELOG.md hashicorp#29285, hashicorp#29294

* Update CHANGELOG.md for hashicorp#29307

* Update CHANGELOG.md hashicorp#29283

* Update CHANGELOG.md hashicorp#29271

* Update CHANGELOG.md hashicorp#29298

* Update CHANGELOG.md hashicorp#29278

* Update CHANGELOG.md hashicorp#29341

* Update CHANGELOG.md hashicorp#29328

* Update CHANGELOG.md hashicorp#29292

* Update CHANGELOG.md hashicorp#29361

* Update CHANGELOG.md hashicorp#29296

* Update CHANGELOG.md hashicorp#28239

* Update CHANGELOG.md hashicorp#28974

* Update CHANGELOG.md hashicorp#29254

* Update CHANGELOG.md hashicorp#29333

* Update CHANGELOG.md hashicorp#29314

* Update CHANGELOG.md hashicorp#28929

* Update CHANGELOG.md for hashicorp#29382

* Update for hashicorp#28676

* Update CHANGELOG.md for hashicorp#28740

* Update CHANGELOG.md for hashicorp#28559

* Update CHANGELOG.md hashicorp#29143

* Update CHANGELOG.md hashicorp#29329

* Update CHANGELOG.md hashicorp#29380

* Update CHANGELOG.md hashicorp#29309

* Update CHANGELOG.md hashicorp#29317

* prep for release

---------

Co-authored-by: Matthew Frahry <mbfrahry@gmail.com>
Co-authored-by: catriona-m <86247157+catriona-m@users.noreply.github.com>
Co-authored-by: kt <kt@katbyte.me>
Co-authored-by: stephybun <steph@hashicorp.com>
Co-authored-by: jackofallops <ste@hashicorp.com>
@github-actions
Copy link
Contributor

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, 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 25, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

azurerm_postgresql_flexible_server validation for "storage_mb" value parameter

2 participants