[英]Terraform: Cloudwatch Canary Synthetics, How to create metric alarm
I try to create an alarm for my canary resource.我尝试为我的金丝雀资源创建警报。 I can't find a solution to reference my canary in my resource for
aws_cloudwatch_metric_alarm
.我找不到在我的
aws_cloudwatch_metric_alarm
资源中引用我的金丝雀的解决方案。 In the console there is a parameter CanaryName
在控制台中有一个参数
CanaryName
I can create my canary with:我可以创建我的金丝雀:
resource "aws_synthetics_canary" "some" {
name = "some-canary"
artifact_s3_location = "s3://some-bucket/"
execution_role_arn = "some-role"
handler = "exports.handler"
zip_file = "test-fixtures/lambdatest.zip"
runtime_version = "syn-1.0"
schedule {
expression = "rate(0 minute)"
}
}
And with aws_cloudwatch_metric_alarm
I want to create the alarm to the associated canary but I am missing a parameter like CanaryName:使用
aws_cloudwatch_metric_alarm
我想为关联的金丝雀创建警报,但我缺少像 CanaryName 这样的参数:
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 = []
}
Namespace CloudWatchSynthetics is working命名空间 CloudWatchSynthetics 正在工作
Any idea how to solve this?知道如何解决这个问题吗?
Thanks!谢谢!
Similar question: https://discuss.hashicorp.com/t/aws-cloudwatch-metric-alarm/14396类似的问题: https://discuss.hashicorp.com/t/aws-cloudwatch-metric-alarm/14396
dimensions = {
CanaryName = "NAME_OF_CANARY"
}
That's how you reference a canary name:-)这就是您引用金丝雀名称的方式:-)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.