terraform-google-sql-db icon indicating copy to clipboard operation
terraform-google-sql-db copied to clipboard

disk_size variable is only used at instance creation

Open philip-harvey opened this issue 2 years ago • 5 comments

TL;DR

disk_size variable is only used at instance creation. Subsequent changes to the disk size are ignored.

Expected behavior

Increasing disk size passed to the module should increase the disk size of the instance if disk__autoresize is false. Decreasing disk size passed to the module should delete and recreate the instance if deletion_protection is set to false

Observed behavior

disk_size is ignored by the module

Terraform Configuration

disk_size = 100
disk_autoresize = false

Terraform Version

Tested with Terraform 1.2.3

Additional information

Issue was previously reported as #148 and was closed without being fixed

philip-harvey avatar Jul 05 '22 19:07 philip-harvey

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days

github-actions[bot] avatar Sep 03 '22 23:09 github-actions[bot]

Not stale

philip-harvey avatar Sep 05 '22 20:09 philip-harvey

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days

github-actions[bot] avatar Nov 04 '22 23:11 github-actions[bot]

@philip-harvey - this is reasonable and I've added this to the backlog. However, if you're able to create a PR for us to review, that sure will speed things up. Thanks.

g-awmalik avatar Nov 09 '22 20:11 g-awmalik

Dependent on https://github.com/hashicorp/terraform/issues/24188.

Since Cloud SQL can auto-size the disk space, we'll need to set ignore changes in the lifecycle block dynamically so it continue to ignore it when disk_autoresize is set to true and honors the change when it is false.

Until dynamic blocks are support for lifecycle, we'll need to continue to ignore changes to the disk size.

g-awmalik avatar Sep 19 '23 18:09 g-awmalik