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.
Solution: Add and test a function with API to your project - Amazon Web Services (AWS) Tutorial
From the course: Complete Guide to Serverless Web App Development on AWS
Solution: Add and test a function with API to your project
(upbeat music) - [Instructor] Let's see how I solve this challenge. First, go to your stack, hello-cdk-stack. And here we can add a new function. Let's minimize this and this, and let's put it under the API gateway that we have defined. So I will write a new function, something like this. The new Lambda function. I'm the most original person with naming. I use the same constructor and I put a new name to it. Entry path is this file, new.ts in the functions directory, We'll create this file in a second. Handler handler and then the runtime, node 20. The bundle configuration is the same that we have done before. Next, I'm going to attach the API gateway to this function. And now we have all the constructs ready. Let's go to our functions directory and create a new file called new.ts. And in here, I will write again a very similar function that doesn't do much. Hello, this is your new Lambda responding, similar thing that we have before. Now you are ready to move on and deploy. So let's…
Contents
-
-
-
The importance of infrastructure as code3m 44s
-
(Locked)
Understanding AWS CDK3m 37s
-
(Locked)
Advantages of AWS CDK3m 53s
-
(Locked)
Installing and configuring AWS CDK6m 19s
-
(Locked)
Building your first project with AWS CDK4m 46s
-
(Locked)
Creating and deploying a Lambda function with API Gateway using CDK7m 7s
-
(Locked)
Challenge: Add and test a function with API to your project1m 10s
-
(Locked)
Solution: Add and test a function with API to your project2m 57s
-
-
-
-
-
-
-
-
-