hands-on lab

Defining Cloud Infrastructure with the AWS Cloud Development Kit and Python

Difficulty: Intermediate
Duration: Up to 1 hour and 30 minutes
Students: 244
Rating: 4/5
This lab is currently under maintenance and unavailable. We are actively working to resolve this issue and we apologize for any inconvenience.

Version 1 of the AWS Cloud Development Kit (AWS CDK) is now in maintenance mode.

Refer to the AWS Cloud Development Kit (AWS CDK) v2 Learning Path for updated CDK v2 Labs and Challenges. 

Get guided in a real environmentPractice with a step-by-step scenario in a real, provisioned environment.
Learn and validateUse validations to check your solutions every step of the way.
See resultsTrack your knowledge and monitor your progress.

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 a library of constructs that cover many AWS services and configurations as well as the CDK Toolkit, which you will learn to use for instantiating your application and deploying your resources to AWS CloudFormation.

In this lab, you will use these features of 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 work in the AWS Console in the later stages of the lab to verify and test the resources spun up by the AWS CDK.

Learning Objectives

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

  • Initialize a new AWS CDK project
  • Import and manage AWS Construct Library modules
  • Define AWS resources using the Python programming language
  • Use the AWS CDK Toolkit to synthesize and deploy an AWS CloudFormation template

Intended Audience

  • Cloud Architects
  • DevOps Engineers
  • Software Engineers

Prerequisites

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

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

The following courses and labs can be used to fulfill the prerequisite:

Updates

December 11th, 2021 - Addressed an issue with a version mismatch between the CDK library and the CDK CLI

Environment before

Environment after

Covered topics

Lab steps

Logging In to the Amazon Web Services Console
Initializing an AWS CDK Project in Python
Defining AWS Resources Using AWS CDK Resource Constructs
Synthesize and Deploy an AWS CloudFormation Stack with the AWS CDK Toolkit
Testing Your CDK Application