hands-on lab

Allocating Resource Attributes with AWS CDK Tokens

Difficulty: Intermediate
Duration: Up to 1 hour
Students: 130
Rating: 5/5
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

AWS CDK Tokens represent resource attributes or values that are meant to be resolved during later stages of a CDK application's lifecycle. Tokens can be resolved in either the synthesis or deployment stage of your application. CDK tokens can serve as placeholders within your stack definitions in order to build your infrastructure without requiring the actual values of certain attributes. Dynamically resolved tokens improve the reusability of your stack definitions.

In this lab, you will deploy a CDK application that uses tokens to define certain resource attributes. The values for each token will be sourced from AWS CloudFormation deployment parameters or the AWS Systems Manager Parameter Store.

Learning Objectives

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

  • Explore the differences between resolving tokens at deployment vs. synthesis time
  • Deploy an AWS CDK application using AWS CloudFormation Parameters
  • Access AWS Systems Manager Parameter Store in your CDK stack

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 Lambda
  • AWS CloudFormation
  • AWS Systems Manager Parameter Store

The following content can be used to fulfill the prerequisite:

Updates

September 24th, 2024 - Resolved command 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

Environment before

Environment after

Covered topics

Lab steps

Logging In to the Amazon Web Services Console
Setting up the AWS CDK Project
Deploying a CDK Stack Using AWS CloudFormation Parameters
Accessing AWS Systems Manager Parameter Values with the AWS CDK