Importing AWS CloudFormation Templates into the AWS CDK

Lab Steps

lock
Setting up the AWS CDK Project
lock
Importing AWS CloudFormation Resources Using the AWS CDK

The hands-on lab is part of this learning path

Ready for the real environment experience?

DifficultyIntermediate
Time Limit30m
Students95
Ratings
5/5
starstarstarstarstar

Description

Transitioning from using AWS CloudFormation to developing applications with the AWS CDK can be a daunting task. Luckily, the AWS CDK offers a solution that can assist in importing and migrating existing CloudFormation templates.

Instead of manually defining these resources using their matching class, developers can utilize the AWS CDK cloudformation-include class to import a stack template and convert resource definitions to L1 constructs.

In this lab, you will use the CfnInclude class to import a predefined website-hosting Amazon S3 bucket into a CDK stack. You will also explore the configuration options available to you after the resources have been successfully imported.

Learning Objectives

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

  • Import an existing AWS CloudFormation template into a CDK application
  • Access an imported template's elements within a CDK application

Intended Audience

  • Cloud Architects
  • DevOps Engineers
  • Software Engineers

Prerequisites

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

  • AWS CDK
  • Amazon S3
  • AWS CloudFormation

The following content can be used to fulfill the prerequisite:

Updates

March 13th, 2023 - Enabled autosave in the lab's browser IDE

Environment before
PREVIEW
arrow_forward
Environment after
PREVIEW
About the Author
Students22839
Labs74
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.