[Enhancement]: Option in aws_cloudwatch_metric_alarm to set up alarm without SCHEMA() Β #27613
Closed as not planned
Closed as not planned
Description
Description
Setting the namespace in an aws_cloudwatch_metric_alarm automatically sets the SCHEMA in the alert's query.
Therefore, it is not possible to set an alarm query with "No schema".
It would be good to have control over this.
The example code on https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_metric_alarm
creates the following metric query (which actually doesn't return any data due to this exact thing).
SELECT AVG(CPUUtilization) FROM SCHEMA("AWS/EC2")
What would be preferred:
SELECT AVG(CPUUtilization) FROM "AWS/EC2"
The sample code from the URL above:
resource "aws_cloudwatch_metric_alarm" "foobar" {
alarm_name = "terraform-test-foobar5"
comparison_operator = "GreaterThanOrEqualToThreshold"
evaluation_periods = "2"
metric_name = "CPUUtilization"
namespace = "AWS/EC2"
period = "120"
statistic = "Average"
threshold = "80"
alarm_description = "This metric monitors ec2 cpu utilization"
insufficient_data_actions = []
}
Affected Resource(s) and/or Data Source(s)
aws_cloudwatch_metric_alarm
Potential Terraform Configuration
No response
References
Would you like to implement a fix?
No response