Skip to content
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

Add force_delete for notification channel #6474

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions mmv1/products/monitoring/terraform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ overrides: !ruby/object:Overrides::ResourceOverrides
NotificationChannel: !ruby/object:Overrides::Terraform::ResourceOverride
id_format: "{{name}}"
import_format: ["{{name}}"]
delete_url: 'v3/{{name}}?force={{force_delete}}'
mutex: stackdriver/notifications/{{project}}
error_retry_predicates: ["isMonitoringConcurrentEditError"]
examples:
Expand All @@ -78,6 +79,17 @@ overrides: !ruby/object:Overrides::ResourceOverrides
skip_test: true
vars:
display_name: "Sensitive Notification Channel test"
virtual_fields:
- !ruby/object:Api::Type::Boolean
name: 'force_delete'
url_param_only: true
default_value: false
description: |
If true, the notification channel will be deleted regardless
of its use in alert policies (the policies will be updated
to remove the channel). If false, channels that are still
referenced by an existing alerting policy will fail to be
deleted in a delete operation.
custom_code: !ruby/object:Provider::Terraform::CustomCode
resource_definition: templates/terraform/resource_definition/monitoring_notification_channel.erb
encoder: templates/terraform/encoders/monitoring_notification_channel.go.erb
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ resource "google_monitoring_notification_channel" "<%= ctx[:primary_resource_id]
labels = {
email_address = "fake_email@blahblah.com"
}
force_delete = false
}