Chapter 2. Hello, CDK!
In this chapter, you will begin building the CDK equivalent of “Hello, World!”—a rite of passage in programming. This will be your first complete CDK application, so there will be a lot of new terms and commands to learn. To start, you will build a simple object store that accepts a text file, triggers an on-demand cloud function called a Lambda function, and prints a greeting to the logs for your function. You will then extend this simple program to serve as the foundation of your Home Energy Coach program. In this chapter, you will deploy the Lambda function that says “Hello.” To get started, you will need to initialize your first CDK project.
Through this project, you will learn:
-
How to initialize and bootstrap a new CDK application
-
How to create a CDK stack and integrate it with your CDK application
-
How to use the
aws-cdk-libstandard library -
How to synthesize, deploy, and destroy a CDK application
-
The definitions of app, stack, construct, and context in CDK
To get started, you will need:
Project Architecture: Build a “Hello, CDK” Lambda Function
In this first project segment, you will build a simple microservice that accepts a .txt file as an input to an S3 bucket, uses Amazon EventBridge to trigger an AWS Lambda function, and prints a greeting to the CloudWatch log screen each time. Figure 2-1 represents this.
Figure ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access