
You will meet the instructor and learn what will be covered in the course, the course prerequisites, and the topics of the first section.
You will understand why you should apply infrastructure as code and how AWS CDK differs from other tools like AWS CloudFormation. You will also learn the AWS CDK concepts.
You will learn to configure and install the AWS CDK Toolkit and bootstrap a new CDK environment in your AWS account and region.
We will cover the 'cdk bootstrap' command.
You will learn to create your first Python AWS CDK application using the sample application provided by the AWS CDK team. You will understand the structure of an AWS CDK application.
We will cover the 'cdk init' command.
You will understand the AWS CDK app lifecycle and learn to synthesize AWS CloudFormation templates from your AWS CDK apps using the AWS CDK Toolkit.
We will cover the 'cdk synth' command.
You will learn to deploy your AWS CDK stacks using the AWS CDK Toolkit to the CDK environment initialized at the beginning of the section.
We will cover the 'cdk deploy' command.
You will learn to delete the AWS CDK stacks deployed via your AWS CDK app using the AWS CDK Toolkit.
We will cover the 'cdk destroy' command.
You will learn about the topics covered in this section.
You will learn to create an empty Python AWS CDK app using the 'app' template provided by the CDK team. We will also revisit the AWS CDK app folder structure.
You will learn L1 constructs, the lowest-level AWS CDK constructs in the hierarchy. We will make an example by defining VPC and Internet Gateway resources in Python using their L1 construct classes.
You will learn to update your AWS CDK stacks by adding new constructs to your AWS CDK app. We will add public and isolated private subnets and utilize control flow tools provided by Python.
You will see how AWS CDK simplifies defining resources compared to AWS CloudFormation's JSON or YAML templates, even if you only use L1 constructs.
You will make an introduction to L2 constructs, first class-citizen AWS CDK constructs in the hierarchy. As an example, we will use only L2 constructs to create the same VPC architecture as the previous lectures. So you will understand how L2 constructs simplify defining AWS resources with sensible defaults compared to L1 constructs.
You will learn to use special L2 construct Python classes to configure AWS resource properties. In our hands-on examples, we will create a new Python AWS CDK application for a serverless architecture and define an Amazon DynamoDB table with AWS CDK's L2 constructs as a start.
You will learn to use Python instance methods to add related resources of an L2-level AWS CDK construct.
As an example, we will define a Python AWS Lambda function scanning the items from the Amazon DynamoDB table created in the last lecture and add a Lambda function URL using an instance method to trigger it easily.
You will learn to use the special Python instance methods provided by AWS CDK's L2 constructs to easily grant IAM permissions to grantees like IAM roles of other AWS resources. In our hands-on examples, we will grant permissions to the Lambda function's role to scan the DynamoDB table.
You will learn to define AWS CloudFormation stack outputs in your AWS CDK stacks. We will define a stack output for the Lambda function URL to access it on our stack easily.
You will learn to use special Python instance methods provided by AWS CDK's L2 constructs to use the Amazon CloudWatch metrics emitted by the underlying AWS resources.
In our hands-on examples, we will define an Amazon CloudWatch alarm for the errors metric of the Lambda function and test it by simulating a failure.
You will learn about the AWS CDK patterns, in other words, L3 constructs, the highest-level constructs in the hierarchy. We will cover the Construct Hub and AWS Solutions Constructs to search for new CDK patterns.
You will learn to import Python packages of CDK patterns (L3 constructs) and use them in your CDK stacks. This time, we will create the previous lectures' AWS Lambda Function and DynamoDB backend using a CDK pattern (L3 construct).
You will learn about the topics covered in this section.
You will learn to allow network connections on AWS CDK using the aws_ec2 package's Connections class with an example of an Amazon EC2 instance configured as a web server.
You will also learn to configure a simple EC2 instance and add commands to its user data script with AWS CDK's Python instance methods to install packages during initialization.
You will learn to allow connections to a default port using AWS CDK and Python, with an example of an Amazon EC2 instance trying to connect to an Amazon RDS DB instance.
It will also be an example of configuring inbound rules between security groups with AWS CDK and Python.
You will learn to remove a resource configuration from your AWS CDK stacks and deploy the changes.
You will learn about AWS CDK assets and how to define S3 assets in your CDK stacks. As an example, we will upload a custom HTML page to S3 and download it on our web server EC2 instance.
We will also cover adding S3 download commands to EC2 user data scripts easily with AWS CDK.
You will learn about the topics covered in this section.
You will learn to configure cross-stack references on AWS CDK using Python. We will divide the sample stack from the last section into two stacks and create references between them.
You will learn to configure nested stacks on AWS CDK using Python and see how AWS CDK simplifies the process. We will take our stacks from the previous lecture under a root stack.
You will learn about the topics covered in this section.
You will learn to add or remove tags in your CDK constructs, and their subconstructs, which are implemented by the CDK's aspects feature behind the scenes. You will be able to set priorities while adding and removing tags.
You will understand what CDK aspects are and how they work. As an example, we will create our first aspect and associate it with our stack.
You will learn to check resource properties and raise warnings or errors accordingly using the CDK's Annotations class by customizing the CDK aspect created in the last lecture.
You will learn to modify resource properties in your CDK aspects. As an example, we will change the invalid instance types detected on EC2 instances to a default value as a correction.
You will learn about AWS CDK tokens and how to resolve them in your aspects with an example of a compliance check to avoid security group rules allowing SSH access from anywhere on the Internet.
You will learn about the testing methods on AWS CDK and how to write unit tests using AWS CDK's fine-grained assertions and the Pytest framework of Python.
As an introduction, we will make an example of writing test assertions for the number of specific resource types in an AWS CloudFormation template synthesized by our AWS CDK app.
You will learn to write test assertions for the properties of resources in your AWS CDK stacks.
In our hands-on examples, we will use fine-grained assertions to test our Amazon EC2 instance's properties. You will learn about AWS CDK's basic assertion matchers.
You will learn about writing test assertions for complex resource properties using AWS CDK's Assertions package's array and object matchers.
We will make an example of testing the inbound rules of our web server instance's security group.
Congratulations on finishing AWS CDK with Python Step by Step!
Learn more about my other courses and get special discounts for them.
A clear, hands-on path to understanding AWS CDK v2 with Python — from fundamentals to multi-stack architectures and testing.
Infrastructure as Code (IaC) is now essential for modern cloud development, and the AWS Cloud Development Kit (CDK) allows you to define AWS infrastructure using familiar programming languages. In this course, you’ll learn to build real AWS architectures using Python and AWS CDK v2 — the latest version of the Cloud Development Kit, built natively on v2 from the start.
You’ll start by setting up your CDK environment and understanding how CDK translates your Python code into CloudFormation templates. Then, you’ll move beyond the basics to explore constructs, networking, assets, and multi-stack applications, applying each concept with hands-on AWS examples including Lambda, DynamoDB, API Gateway, EC2, and S3.
You'll also learn how to test and validate your infrastructure code using Pytest and CDK Assertions, and apply Aspects to automate tagging, validation, and compliance checks — ensuring your deployments are consistent and secure.
Each lesson is designed to be clear, structured, and practical, showing not only how to use CDK but why each configuration behaves the way it does. By combining theory with guided demonstrations, you’ll gain the skills and confidence to build and manage AWS infrastructure programmatically using Python — step by step.