[英]Identifying AWS unhealthy hosts in target group
我有多個在AWS ALB后面運行的targetGroups。 此外,我設置了cloudwatch警報來監視這些目標組的運行狀況。 每當該組中的目標生成不健康主機警報時,AWS都會發送電子郵件提醒我該組中的目標遭受了不健康。 但是,警報和電子郵件不會通知我該目標組的哪個實例不正常。
有沒有一種方法或解決方案可以實施並找出導致該問題的目標人群?
# Trigger the lambda function when an EC2 instance is terminated
resource "aws_cloudwatch_event_rule" "instance_terminated" {
name = "ChefCleanup-InstanceTerminated-rule"
description = "Capture each EC2 instance termination"
event_pattern = <<PATTERN
{
"source": [ "aws.ec2" ],
"detail-type": [ "EC2 Instance State-change Notification" ],
"detail": {
"state": [ "terminated" ]
}
}
PATTERN
}
# Set event target to call the lambda
resource "aws_cloudwatch_event_target" "instance_terminated" {
rule = "${aws_cloudwatch_event_rule.instance_terminated.name}"
target_id = "chef-cleanup-lambda"
arn = "${aws_lambda_function.chef_cleanup.arn}"
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.