我尝试为我的金丝雀资源创建一个警报。我在我的aws_cloudwatch_metric_alarm资源中找不到一个解决方案来引用我的金丝雀。在控制台中有一个参数CanaryName
我可以用以下命令创建我的金丝雀:
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)"
}
}使用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 = []
}命名空间CloudWatchSynthetics正在运行
你知道怎么解决这个问题吗?
谢谢!
类似的问题:https://discuss.hashicorp.com/t/aws-cloudwatch-metric-alarm/14396
发布于 2021-05-25 14:02:39
dimensions = {
CanaryName = "NAME_OF_CANARY"
}这就是引用金丝雀名称的方式:-)
https://stackoverflow.com/questions/67604444
复制相似问题