Reacting to CodeCommit Events with AWS Lambda

Lab Steps

lock
Logging in to the Amazon Web Services Console
lock
Creating a New CodeCommit Repository
lock
Creating an SNS Topic and a Subscription
lock
Implementing a Lambda Function to Process CodeCommit Events
lock
Connecting to the Virtual Machine using EC2 Instance Connect
lock
Testing the CodeCommit Trigger

The hands-on lab is part of these learning paths

DevOps Engineer – Professional Certification Preparation for AWS
course-steps
35
certification
5
lab-steps
18
quiz-steps
2
description
3
Certified Developer – Associate Certification Preparation for AWS
course-steps
29
certification
5
lab-steps
22
description
2

Ready for the real environment experience?

DifficultyBeginner
Time Limit2h
Students1304
Ratings
4.4/5
starstarstarstarstar-half

Description

AWS CodeCommit lets you host private Git repositories within the AWS ecosystem. It is secure, highly-scalable, and fully compatible with traditional Git tools.

You can configure CodeCommit to trigger actions when events happen such as:

  • Pushing new code
  • Creating new branches
  • Creating tags
  • Merging branches

This allows you to send notifications, integrate with third-party services, or implement custom logic.

In this lab, you will learn how to process CodeCommit events with a Lambda function. As a simple example, you will use Python to create custom SNS notifications, containing useful information about branches and messages for each commit.

Learning Objectives

This is a beginner level lab. Upon completion of this lab you will be able to:

  • Create a CodeCommit repository
  • Create an SNS topic and a subscription
  • Implement a Lambda function to process your CodeCommit events
  • Test that your Lambda function processes events and sends a notification

Intended Audience

  • Developers
  • Cloud Engineers

Prerequisites

You should have a conceptual understanding of source control.

This lab involves sending email notifications, you will need an email address you can check to complete the lab.

Familiarity with the following will be beneficial but is not required:

  • Python programming language
  • Linux command-line
  • Publish/Subscribe asynchronous messaging 

The following courses can be used to fulfill the prerequisites:

Updates

June 3rd, 2020 - All screenshots and instructions updated

January 10th, 2019 - Added a validation Lab Step to check the work you perform in the Lab

Environment before
PREVIEW
arrow_forward
Environment after
PREVIEW

About the Author

Andrew is a Labs Developer with previous experience in the Internet Service Provider, Audio Streaming, and CryptoCurrency industries. He has also been a DevOps Engineer and enjoys working with CI/CD and Kubernetes.