基于2个队列的自动策略?
我设法设置了一个警报/自动策略,该策略根据SQS队列中的消息触发。但是,我有2个队列与此过程不可或缺的一部分 - 仅当两个队列满足触发要求时,我才需要警报才能触发。因此,这样的事情:
resource "aws_cloudwatch_metric_alarm" "messages_not_visible" {
alarm_name = "q1"
comparison_operator = "LessThanThreshold"
...
dimensions = {
QueueName = "q1.fifo", "q2.fifo"
}
alarm_actions = [aws_appautoscaling_policy.scale_down_policy.arn]
}
这显然会出现,因为它只接受了字符串。我尝试为这两个队列发出2个单独的警报,但我不希望我的EC缩放两次,因为它触发了2次。只有当两个触发器都满足时。我在这里做什么?
I managed to set an alarm/autoscaling policy that triggers based on messages in an SQS queue. However, I have 2 queues integral to this process - I need my alarm to trigger only when BOTH of the queues meet the trigger requirements. So something like this:
resource "aws_cloudwatch_metric_alarm" "messages_not_visible" {
alarm_name = "q1"
comparison_operator = "LessThanThreshold"
...
dimensions = {
QueueName = "q1.fifo", "q2.fifo"
}
alarm_actions = [aws_appautoscaling_policy.scale_down_policy.arn]
}
This obviously errors out, as it only accepts a string. I tried making 2 separate alarms for those 2 queues, but I don't want my ECS to be scaled down twice because it triggers 2 times. Only when both of the triggers are satisfied. What do I do here?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要使用“ nofollow noreferrer”> CloudWatch公制数学创建一个基于多个度量的警报。
You'll need to use CloudWatch Metric Math to create an alarm that is based on more than one metric.