Importing AWS CloudFormation Templates into the AWS CDK
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
June 13th, 2024 - Resolved IAM permission issue
April 17th, 2024 - Resolved IAM permission issue
August 16th, 2023 - Remove Node deprecation warning and updated CDK CLI version
March 13th, 2023 - Enabled autosave in the lab's browser IDE