Build Java REST API using API Gateway, AWS Lambda, DynamoDB & Serverless framework on AWS
Prerequisites
- AWS account setup with AWS Access Key Id and Secret Access Key
- AWS CLI installed in your local machine
- Java installed in your local machine
- Install Node.js & npm on your local machine
Initial Setup
- Install serverless framework on your local machine by running the below npm command
$ npm install -g serverless
2. Verify serverless installation
$ serverless -v
Framework Core: 1.71.3
Plugin: 3.6.12
SDK: 2.3.0
Components: 2.30.11
Create Serverless project
Run the below serverless command to generate serverless project using the aws-java-maven template
$ serverless create --template aws-java-maven --name serverless-restapi
Serverless: Generating boilerplate...
_______ __
| _ .-----.----.--.--.-----.----| .-----.-----.-----.
| |___| -__| _| | | -__| _| | -__|__ --|__ --|
|____ |_____|__| \___/|_____|__| |__|_____|_____|_____|
| | | The Serverless Application Framework
| | serverless.com, v1.71.3
-------'