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 réponse
0
Réponse acceptée

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
EXPERT
répondu il y a un an
  • 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.

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions