Open red8888 opened 2 months ago
Confirmed issue!
It is possible to import other resources, but not a google_monitoring_alert_policy
with next steps:
google_monitoring_alert_policy
(can use this example)resource "google_monitoring_alert_policy" "alert_policy" { display_name = "alert-policy-18463" combiner = "OR" conditions { display_name = "test condition" } }
terraform import google_monitoring_alert_policy.alert_policy {{alert-policy-18463}}
Output:
Error creating AlertPolicy: googleapi: Error 400: Field alert_policy.conditions[0].condition_case had an invalid value of "0": Condition subtype (e.g. "condition_absent","condition_threshold", etc.) is absent or unknown.
Community Note
Terraform Version & Provider Version(s)
Any
Affected Resource(s)
Docs: https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/monitoring_alert_policy#import
Terraform Configuration
NA
Debug Output
No response
Expected Behavior
No response
Actual Behavior
No response
Steps to reproduce
No response
Important Factoids
No response
References
See previously closed issue: https://github.com/hashicorp/terraform-provider-google/issues/7693
Still a problem I just got bit by this. That issue has a PR with the doc update ^ can someone merge that?
Also, even more annoying, I can't figure out how to get the ID of a policy, how the heck do you get this info? I had to terraform a policy just so I could look at the state output and see the number.
b/348474289