From the course: Complete Guide to Serverless Web App Development on AWS

Unlock this course with a free trial

Join today to access over 24,600 courses taught by industry experts.

Creating a simple API Gateway with Lambda using AWS CDK

Creating a simple API Gateway with Lambda using AWS CDK - Amazon Web Services (AWS) Tutorial

From the course: Complete Guide to Serverless Web App Development on AWS

Creating a simple API Gateway with Lambda using AWS CDK

- [Instructor] Now that you know more about APA gateway, let's integrate it into our to-do application. We'll build a simple backend for two to-dos APIs. First, we are going to create a new to-do and then we are going to get all the to-dos. These APIs will connect to our client web app to the backend, using API gateway. The backend will be implemented with AWS Lambda. For this demo, we will use a single Lambda function that handles all the different path and methods for our API. However, you can use also separate functions for each path method combination in API gateway. Let's go to our code and start building. So the first thing we want to do is to create a new stack. So let's create the backend stack. And here, we are going to find our API gateway Lambda and everything that is related to that. So let's create our stack, let's call it backend stack. And let's put the constructor and I will put here, props, and let's close all the brackets and bring all the imports. And now we can…

Contents