What to do to include details of the target, whose health checks failed, in the mail notification? (Lambda, SNS)

0

Backend API applications could be running on an EC2 instance, a PaaS like Elastic Beanstalk or even a container runtime platform like ECS. As you might already be aware, we configure the Target Groups with the application's health check endpoint, and allow the Load Balancer to determine the health with certain threshold parameters. We are able to run the health check periodically and send out an email ONLY when the check does not pass. Now, what do I do to include details of the target, whose health checks failed, in the mail? and is there a way to do it completely through console?

1 回答
0
已接受的回答

Set CloudWatch alarms to alarm when health checks exceed thresholds.
Triggered by the alarm, Lambda executes "describe_target_health" to retrieve those with "unhealthy" status.
How about sending that information from Lambda to SNS for email notification?

Reference Documents:
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/elbv2/client/describe_target_health.html
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/sns/client/publish.html

profile picture
专家
已回答 1 年前
  • Thanks, I am getting some idea. And is there a way for it to do it completely through console

  • It is not possible to configure this setting using only the management console.
    The use of Lambda will be mandatory.
    If this answer has led to a solution, please approve the answer for the betterment of the community.

  • Thank you.

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则