Defining Cloud Infrastructure with the AWS CDK v2 in Python

Lab Steps

lock
Logging in to the Amazon Web Services Console
lock
Initializing an AWS CDK Application in Python
lock
Simplifying Infrastructure Development with Curated CDK Constructs
lock
Deploying AWS Resources with the AWS CDK CLI
lock
Testing the AWS CDK Application

The hands-on lab is part of these learning paths

Ready for the real environment experience?

DifficultyIntermediate
Time Limit1h
Students141
Ratings
4.3/5
starstarstarstarstar-half

Description

The AWS Cloud Development Kit (AWS CDK) is an open-source software development framework used to define your cloud application resources using familiar programming languages.

Before the AWS CDK, you had to rely heavily on AWS CloudFormation or AWS Serverless Application Model (AWS SAM) to define your cloud application resources, which required a decent understanding of YAML or JSON. The AWS CDK provides a programming model above these native template languages that increase productivity when developers are building out their infrastructure as code.

The AWS CDK includes the AWS Construct Library which supports many AWS services and configurations as well as the AWS CDK Toolkit which serves as the primary tool for instantiating and deploying your resources to AWS CloudFormation.

In this lab, you will use the AWS CDK Toolkit to create an AWS CloudFormation stack using the Python programming language.

The majority of the steps in this lab will be performed in a code IDE, but you will be logging into the AWS console in the later stages of the lab to verify and test the resources spun up by the AWS CDK.

Important: This hands-on lab uses the latest AWS CDK v2. For hands-on labs and challenges that use the AWS CDK v1, refer to the Get Hands-on with the AWS Cloud Development Kit (CDK v1) learning path.

Learning Objectives

Upon completion of this intermediate-level lab, you will be able to:

  • Initialize a new AWS CDK project
  • Employ constructs from the AWS Construct Library in Python
  • Use the AWS CDK Toolkit to synthesize and deploy an AWS CloudFormation template
  • Invoke an AWS Lambda function with an Amazon S3 bucket event notification

Intended Audience

  • Cloud Architects
  • DevOps Engineers
  • Software Engineers

Prerequisites

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

  • Python
  • AWS CloudFormation
  • AWS Lambda
  • Amazon Simple Storage Service (S3)

The following content can be used to fulfill the prerequisite:

Updates

October 3rd, 2022 - Resolved CDK command issue

 

Environment before
PREVIEW
arrow_forward
Environment after
PREVIEW
About the Author
Students20425
Labs64
Learning paths3

Jun is a Cloud Labs Developer with previous experience as a Software Engineer and Cloud Developer. He holds the AWS Certified Solutions Architect and DevOps Engineer Professional certifications. He also holds the AWS Certified Solutions Architect, Developer, and SysOps Administrator Associate certifications. 

Jun is focused on giving back to the growing cloud community by sharing his knowledge and experience with students and creating engaging content.