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.

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南