Home > Back-end >  Can AWS Lambda act as an API?
Can AWS Lambda act as an API?

Time:06-12

Trying to figure out the differences. Can AWS Lambda act as an API or vice versa? Would I still need to setup an API if I wanted to use Lambda functions or can I use Lambda functions right from the get go?

CodePudding user response:

AWS Lambda can be used to serve an API. You could use API Gateway for setting up the API, and the serving can be done via a Lambda. It is a nice pattern.

Ref: https://docs.aws.amazon.com/apigateway/latest/developerguide/getting-started-with-lambda-integration.html

And to your main question, I don't think you can directly configure an API in AWS Lambda service.

CodePudding user response:

Alternatively, you can do it by setting a Function URL to your lambda.

It will require changes in how you receive input and send the output for the lambda and also has some limitations related to authentication. Still, it would be a more self-contained approach than the API Gateway integration if you need to expose your API publicly.

  • Related