Notification in AWS when a new target becomes healthy ECS

+2 votes

I have a common scenario but I haven't managed to find a solution for it.

I'm using ECS in AWS for various services. Whenever a new build occurs in my CI a new Docker image is pushed up to ECR and a lambda triggered to cause ECS to deploy the new image. All of this works fine. But, I want to get notified whenever there's live new code, which is basically when a newly registered target becomes healthy.

Any suggestions as to how can I trigger a notification when a new target on an ELB becomes healthy?

Thanks!

Aug 23, 2018 in AWS by bug_seeker
• 15,550 points
150 views

1 answer to this question.

+1 vote

You could probably use the HealthyHostCount metric to configure your use case. This would alarm you if configured correctly.

This assumes you're actually deploying a new EC2 host before draining off the old one. You can verify this by watching your metrics and confirming your HealthyHostCount exceeds your DesiredHostCount for any period of your time.

Once you have done the verification and when HealthyHostCount does, in fact, exceed your DesiredHostCount, you'll set up a CloudWatch Alarm to only detect any maximum > [DesiredCount] for 1 out of 1 data points for any 1 minute period. 

The period you set here should be small enough so as to not overlap with successive deployments (since the max won't change within a given period if you've deployed multiple times).

answered Aug 23, 2018 by Priyaj
• 58,120 points

edited Jun 8, 2020 by Sirajul

Related Questions In AWS

0 votes
2 answers

How to skip headers when reading a CSV file in S3 and creating a table in AWS Athena?

Thanks for the answer. This should be clear ...READ MORE

answered Aug 14, 2019 in AWS by athenauserz
5,983 views
0 votes
1 answer

How to create a new service in ECS cluster behind a load balancer?

Hi@akhtar, The following create-service example shows how to create a ...READ MORE

answered Nov 8, 2020 in AWS by MD
• 95,200 points
153 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Creating A New MySQL User In Amazon RDS Environment

AWS RDS security groups documentation (a common ...READ MORE

answered Jul 18, 2018 in AWS by Priyaj
• 58,120 points
1,164 views