A Word Regarding EventBridge (CloudWatch Events)
Start course
1h 27m

This course covers the core learning objective to meet the requirements of the 'Designing Compute solutions in AWS - Level 3' skill

Learning Objectives:

  • Evaluate and enforce secure communications when using AWS elastic load balancers using HTTPS/SSL listeners
  • Evaluate when to use a serverless architecture compared to Amazon EC2 based upon workload performance optimization
  • Evaluate how to implement fully managed container orchestration services to deploy, manage, and scale containerized applications

There are plenty of use cases when you need to take certain actions when an instance is launched. Say for example, you need to tag instances to follow standards, and for billing purposes, or perhaps call an external API to notify a custom monitoring tool, or inventory tracking application. In other words, there are events that you want to trigger off auto scaling, but don't necessarily need to occur during the startup sequence or termination of your instance. They can occur a few seconds early or late, without any significant impact. In this case, a better choice would be to use event bridge as an alternative to auto scaling lifecycle hooks. This diagram illustrates the idea behind this option. Event bridge gets notified of all auto scaling activities in your account, and it's your job to identify the auto scaling group that you're interested in, by filtering events.

Once you do this, you'll get notified of scale-in and scale-out events, which you can then use to trigger actions. In this case, we can create an AWS lambda function, and perform our desired actions, which could include; EC2 fleet to fleet tracking, notifications, third party tags, and many more. The key to remember here is that all this can occur, decouple from your EC2 instances. If you needed something to occur within your instance at a specific time, such as startup or termination, then this idea wouldn't work, and the lifecycle hook is the appropriate choice. Here's a link for the AWS documentation, regarding auto scaling and event bridge.


About the Author
Carlos Rivas
Sr. AWS Content Creator
Learning Paths

Software Development has been my craft for over 2 decades. In recent years, I was introduced to the world of "Infrastructure as Code" and Cloud Computing.
I loved it! -- it re-sparked my interest in staying on the cutting edge of technology.

Colleagues regard me as a mentor and leader in my areas of expertise and also as the person to call when production servers crash and we need the App back online quickly.

My primary skills are:
★ Software Development ( Java, PHP, Python and others )
★ Cloud Computing Design and Implementation
★ DevOps: Continuous Delivery and Integration