Version 1 of the AWS Cloud Development Kit (AWS CDK) is now in maintenance mode.
Refer to the AWS Cloud Development Kit (AWS CDK) v2 Learning Path for updated CDK v2 Labs and Challenges.
Custom CDK constructs allow organizations to implement specific configurations on AWS services to meet their requirements. Although writing custom constructs provides the guardrails to allow this, the development of the constructs themselves requires a form of testing to ensure these requirements are met. The Snapshot Testing AWS CDK Constructs hands-on lab introduced the built-in Jest testing framework and how to incorporate snapshot tests into your CDK development process.
Snapshot tests verify that a construct will generate the same template resource definition every time, but how can developers ensure the constructs are utilized correctly while they build out their applications?
Fine-grained assertions are tests that drill down to the individual properties of your constructs and ensure that specific values are set. Validation tests check your CDK constructs to make sure they raise the appropriate errors when you pass them invalid data.
In this lab, you will write fine-grained assertions and validation tests to evaluate a custom Amazon Kinesis stream construct.
Upon completion of this intermediate-level lab, you will be able to:
Familiarity with the following will be beneficial:
Refer to the following labs to fulfill the prerequisite: