Infrastructure as Code with AWS CDK v2

Infrastructure as Code with AWS CDK v2
Infrastructure as Code with AWS CDK v2

CLOUD LABS



Infrastructure as Code with AWS CDK v2

In this Cloud Lab, you’ll learn how to use AWS Cloud Development Kit (CDK) v2 to define, configure, and deploy cloud infrastructure.

9 Tasks

beginner

2hr

Certificate of Completion

Desktop OnlyDevice is not compatible.
No Setup Required
Amazon Web Services

Learning Objectives

An understanding of CDK core components and project initialization
An understanding of CDK bootstrap and its customization
The ability to provision resources using different construct layers of AWS CDK
Familiarity with synthesizing and deploying stacks using AWS CDK CLI

Technologies
AWS CLI
CloudFormation logoCloudFormation
Cloud Lab Overview

Provisioning and managing AWS infrastructure manually can become challenging as applications grow. Teams often struggle with maintaining consistency across environments, reusing components, and tracking changes over time. Manual setups or even raw configuration templates can be error-prone and hard to evolve. This is where infrastructure as code (IaC) with the AWS Cloud Development Kit (CDK) truly shines. CDK enables you to define infrastructure in familiar programming languages, allowing you to apply software engineering practices, such as abstraction, reusability, and testing, directly to your infrastructure.

In this Cloud Lab, you’ll learn how to use AWS CDK to define and deploy cloud infrastructure. You’ll start by looking into CDK’s core components and see how they work together to model cloud infrastructure in code. You’ll then initialize a new CDK project and explore its structure. Next, you’ll bootstrap the project with a custom bootstrap stack, ensuring that your environment is prepared for deploying resources securely and consistently.

From there, you’ll build real AWS resources using different levels of CDK constructs. You’ll create a DynamoDB table using a low-level (L1) construct to gain fine-grained control over its configuration. Then, you’ll define a Lambda function with a higher-level (L2) construct, simplifying setup with built-in defaults and abstractions. To complete the application, you’ll expose the Lambda function through an API Gateway created using a higher-level (L3) construct, demonstrating how CDK makes it easy to stitch services together.

After completing this Cloud Lab, you’ll understand how to design and deploy AWS infrastructure using CDK. You’ll gain hands-on experience with CDK’s project life cycle, from initialization and bootstrapping to writing code with different construct levels and deploying a complete serverless application. By the end, you’ll see how CDK brings clarity, consistency, and speed to managing infrastructure on AWS.

The following is the high-level architecture diagram of the infrastructure you’ll create in this Cloud Lab:

Provisioning AWS infrastructure using AWS CDK
Provisioning AWS infrastructure using AWS CDK
Cloud Lab Tasks
1.Introduction
Getting Started
2.Set Up the Project
Understand the Core Components of AWS CDK
Initialize a Project
Bootstrap the Project
3.Create Infrastructure Using CDK
Create a DynamoDB Table
Provision a Lambda Function
Expose Your Application
4.Conclusion
Clean Up
Wrap Up
Labs Rules Apply
Stay within resource usage requirements.
Do not engage in cryptocurrency mining.
Do not engage in or encourage activity that is illegal.

Relevant Course

Use the following content to review prerequisites or explore specific concepts in detail.

Hear what others have to say
Join 1.4 million developers working at companies like