-
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
Allow optional storage size with auto_grow
enabled
#5121
Comments
Hey @croissong, as a workaround i'd propose the following: resource "azurerm_postgresql_server" "db" {
...
storage_profile {
storage_mb = var.storage_mb
auto_grow = "Enabled"
}
lifecycle {
ignore_changes = [storage_profile.storage_mb]
} Is that a viable option for you? Tbf I didn't test that but it might work. |
For anyone else facing this issue, I found that the following minor tweak to @r0bnet 's solution worked in Terraform v0.12.20.
|
refactor code and tests to support for create_mode, creation_source_server_id, infrastructure_encryption_enabled,public_network_access_enabled, ssl_minimal_tls_version_enforced properties support replicas computed storage_mb when auto_grow_enabled is true use booleans for toggle properties by renaming: -- ssl_enforcement -> ssl_enforcement_enabled -- geo_redundant_backup -> backup_geo_redundant_enabled -- auto_grow -> auto_grow_enabled move all properties within the storage_profile block to the top level superseeds #6241 fixes #6216 fixes #6180 fixes #5865 fixes #5121 fixed #2819
This has been released in version 2.7.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.7.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
Description
We're experiencing an undesired behavior when enabling
auto_grow
for a postgresql server.As the
storage_mb
setting is required, each time the storage size is automatically increased via autogrow, terraform detects a change andstorage_mb
needs to be manually increased as well.Ideally,
storage_mb
would be optionally ifauto_grow
is enabled.New or Affected Resource(s)
azurerm_postgresql_server
Potential Terraform Configuration
The text was updated successfully, but these errors were encountered: