Open Luke-Scott opened 3 years ago
This appears to be an API bug. Duration in below request is working
{
"combiner": "OR",
"conditions": [
{
"conditionThreshold": {
"aggregations": [
{
"alignmentPeriod": "60s",
"perSeriesAligner": "ALIGN_RATE"
}
],
"comparison": "COMPARISON_GT",
"duration": "60s",
"filter": "metric.type=\"compute.googleapis.com/instance/disk/write_bytes_count\" AND resource.type=\"gce_instance\""
},
"displayName": "test condition"
}
],
"displayName": "issue9576_alert2",
"enabled": true,
"userLabels": {
"foo": "bar"
}
}
Community Note
modular-magician
user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned tohashibot
, a community member has claimed the issue already.Terraform Version
Terraform v1.0.2 provider registry.terraform.io/hashicorp/google v3.75.0
Affected Resource(s)
resource "google_monitoring_alert_policy"
Terraform Configuration Files
Expected Behavior
As you can see from the Terraform Plan output it will create one resource - an alerting policy within GCP's Monitoring.
Actual Behavior
Expected type 'Duration' but got 'String'.
It complains that the duration argument needs to be in the data type 'Duration' and not a string. Is it possible to cast a Duration data type? However, if I then remove the string and make it an integer I get the following error.
Illegal duration format; duration must end with 's'
Doesn't that then mean it has to be a string? It seems to contradict itself.
Here is what's on the Terraform Docs for Duration:
Steps to Reproduce
terraform apply