Open JakeCooper opened 6 months ago
This scenario was detected as a possible enhancement not as a bug, so it was forwarded to take in consideration for the future
Sounds good! Apologies if I added the wrong label
Enhancement makes sense given my understanding of the terraform state machine
To clarify, this isn't an enhancement in relation to the provider itself.
Updating a snapshot policy in the console does not recreate it.
This is a bug in relation to Google's API and Product definition
According to the Google Cloud Docs, this behavior does not match the stated behavior for Google Cloud and is thus a bug, not an enhancement
https://cloud.google.com/compute/docs/disks/manage-snapshot-schedules#change_snapshot_schedule
This should be resolved with https://github.com/GoogleCloudPlatform/magic-modules/pull/11091
Community Note
Terraform Version
1.8
Affected Resource(s)
google_compute_resource_policy
Terraform Configuration
Debug Output
Expected Behavior
Since the Google Cloud UI allows you to edit snapshot schedules and change the timeframe (days, weeks, etc), it SHOULD edit the policy not destroy it
Actual Behavior
The policy is destroyed and recreated
Steps to reproduce
terraform apply
Important Factoids
Normally this wouldn't be an issue, but, if you recreate a snapshot policy, it'll orphan any old snapshots created by it (NOT remove them)
Which means Google will keep around a range of snapshots for every lifecycle change that forces a replacement. Example: You change the policy 2x, it'll keep 3 "generations" of snapshots around (and charge you 3x for it)
This is a 200k bug for us at @railwayapp :/.
References
No response
b/335507340