Skip to content

Latest commit

 

History

History
75 lines (51 loc) · 2.29 KB

README.md

File metadata and controls

75 lines (51 loc) · 2.29 KB

product-serverless-service

Sample serverless application using Micronaut, AWS Lambda and API Gateway

Endpoints

picture

Build Application

product-serverless-service % ./gradlew build

Start Application

This command starts the docker containers, sam local api and build the project.

product-serverless-service % make run

Debug Application

1 - Configure intellij remote debugging. picture

2 - Execute this command

product-serverless-service % make debug

3 - Send request

4 - Start debug

picture

Create lambda function

1 - Create a lambda function in aws console using Java 11 Corretto runtime. picture

2 - Execute the gradle build and upload the jar located on build/libs path. picture

3 - Configure the function handler using MicronautLambdaHandler. picture

4 - Add an environment variable with the mongodb url. In this project I used mongodb atlas. Like amazon, they offer a database in free tier. picture

5 - Finally, you can send a api gateway event to the function and see the result. picture picture picture

Create api gateway

1 - Create an api gateway of rest api type.

2 - Map methods and resources like product controller.

3 - For each method, select lambda function and enable lambda proxy integration. picture

4 - After that, you can test your functions. picture

5 - At last, after deploy your api gateway, it will be avaliable to access. picture