Notification in AWS when a new target becomes healthy ECS

+1 vote

I'm looking to do something that seems like a common use case, however I have not been able to find any information anywhere that leads to a solution for what I want.

I'm using ECS in AWS for various services. When 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. This all works great. What I am struggling with is that I want to be notified somehow when the new code becomes 'live', this basically equates to when the newly registered target becomes healthy.

Does anybody have any suggestions as to how I can trigger a notification when a new target on an ELB becomes healthy?

Aug 23, 2018 in AWS by bug_seeker
• 14,960 points
20 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
+1 vote

I'm fairly confident you should be able to use the HealthyHostCount metric for your alarm, if you adjust it correctly. This assumes you're actually deploying a new EC2 host before draining off the old one. You can verify this by looking at your metrics and confirming your HealthyHostCount exceeds your DesiredHostCount for any period of time. If this isn't the case, update your question with the details, as that answer (detecting new service deployments vs new hosts) is a bit different.

Once you've verified your HealthyHostCount does in fact exceed your DesiredHostCount, you can setup a CloudWatch Alarm to just 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).


example

answered Aug 23, 2018 by Priyaj
• 56,100 points

Related Questions In AWS

0 votes
1 answer

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

This is a known deficiency. The best ...READ MORE

answered Sep 4, 2018 in AWS by Archana
• 3,770 points
471 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,240 points
21 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
• 56,100 points
16 views
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
• 56,100 points
52 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.