CloudWatch Events

Length: 00:20:40

Lesson Summary:

CloudWatch Events allow us to create rules that we can trigger by services and API calls or through scheduling. These rules can then interact with many different services in our environment. CloudWatch Events are the central block in many automation workflows we can build as well. This lesson dives into the specifics and shows some examples of how we can use this service.

Lambda Function

import boto3

def lambda_handler(event, context):

    # set the region to the region the event occured in

    print 'detected stopped instance : ' + str(instances)
    ec2 = boto3.client('ec2', region_name=region)
    print 'started your instances: ' + str(instances)

This lesson is only available to Linux Academy members.

Sign Up To View This Lesson
Or Log In

Looking For Team Training?

Learn More