Notification in AWS when a new target becomes healthy ECS

+1 vote

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,400 points
74 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
• 57,550 points

edited Jun 8 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
3,628 views
0 votes
1 answer

if instance is a part of some AutoScaling Group in AWS or not ?

You can run this command below on ...READ MORE

answered Jun 1, 2018 in AWS by Cloud gunner
• 4,630 points
149 views
0 votes
1 answer

Do you get charged for a security group in AWS EC2?

There is no charge applicable to Security ...READ MORE

answered Jul 18, 2018 in AWS by Priyaj
• 57,550 points
1,396 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
• 57,550 points
780 views