Configuring a basic CloudWatch event
Let's take a real-life scenario of how CloudWatch Events can be quite important to use for a very simple solution. Let's assume that an organization, MCS Consulting, owns a bunch of staging servers used as EC2 instances. These servers are not used for 24 hours and are only used when the developers need to run application tests. This means that running the server just within the working hours, that is, between 9 a.m. to 5 p.m. or 6 p.m., is how much is needed for useful purposes. This means that between 6.01 p.m. and 8.59 a.m., the EC2 instance(s) can be shut down, which will result in some huge cost savings for running those instances. This configuration can be done using CloudWatch Events. For this to work, we need the instance ID(s) of the EC2 instance we wish to place on this schedule. Let's assume the instance ID is i-1234567890abcdef0
.
For this setup, we will not be using the event pattern; instead, we will be going through...