Fail to destroy and recreate google_monitoring_uptime_check_config if there is a linked google_monitoring_alert_policy #3133
Labels
bug
forward/review
In review; remove label to forward
service/monitoring-alerting
service/monitoring-uptime
Community Note
Terraform Version
Affected Resource(s)
Terraform Configuration Files
Debug Output
googleapi: Error 400: Cannot delete check my-check. One or more alerting policies is using it.
Full output here
Expected Behavior
Linked google_monitoring_alert_policy should be destroyed and recreated (because the underlying google_monitoring_uptime_check_config also needs to be destroyed and recreated)
Actual Behavior
TF tries to delete and recreate the uptime check, but fails because the API doesn't allow it to be deleted (because it has an alert linked to it)
Steps to Reproduce
terraform apply
terraform apply
References
Period destroy-and-recreate behaviour was fixed in #2703, however this is a pretty useless change given that most uptime checks will probably want an alert associated with them! Issue #3132 is also related to the uptime_check resource, where again TF attempts an amend instead of a destroy and recreate. Perhaps worth looking through the Google API to see if there are any other changes that need making too?
The text was updated successfully, but these errors were encountered: