Chapter 4. Integrating CDK Constructs
In this chapter, you will integrate multiple CDK constructs to create a dynamic greeting by uploading data to your S3 bucket. This will be the final modification to your “Hello, World” CDK application. You’ll chain together an S3 bucket, an EventBridge notification, and a Lambda function to return a dynamic greeting. Later we’ll modify this event-driven architecture to accept utility data and calculate usage patterns.
An S3 event notification is a way to trigger an AWS Lambda function when an object is uploaded to an S3 bucket. This is a common pattern for building event-driven architectures.
You can think of an S3 event notification as a universal remote control with buttons that trigger actions in different applications. When you press a button, a signal goes to the remote control hub. The hub then sends commands to take appropriate actions in the linked apps and services for that button.
An event notification makes it easier to build serverless architectures. Services can generate events when something happens, and rules can route them to serverless compute like Lambda to take action on those events. This decouples and scales applications by avoiding direct dependencies. Event notifications handle all the event ingestion, buffering, routing, and delivery reliability. It eliminates complexity so that you can focus on writing code to react to events.
In our application, we will use S3 event notifications to fire events when data is uploaded ...
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