From the course: AWS Quick Tips for Developers

Unlock this course with a free trial

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

Hitting an AWS Lambda via API Gateway

Hitting an AWS Lambda via API Gateway - Amazon Web Services (AWS) Tutorial

From the course: AWS Quick Tips for Developers

Hitting an AWS Lambda via API Gateway

- [Instructor] If you have a Lambda function that you want to be able to call with a URL, you want to add an API Gateway trigger. Let's look at our Lambda function. It's basically just a simple function that returns the status, code headers, and bodies. We're using text/plain, but you could use application/json or whatever else you need, but this format is important because when it creates the API Gateway for us it's going to use Lambda proxy and it'll expect this format. We can add the trigger, select the API Gateway trigger, set the security to Open and add it. Once it's been added, it'll give us a URL to call and notice it's only displaying the body. But if we wanted to change the API, we can take off the Lambda proxy integration in the Integration Request. We just unclick this box, click Okay and Okay, and then we have to redeploy our API. We'll pick our development stage, give it some description, and deploy it. And then, once it's finished deploying, we can refresh this page and…

Contents