A basic pet store written with the Spring Boot 2 framework. The StreamLambdaHandler
object is the main entry point for Lambda.
The application can be deployed in an AWS account using the Serverless Application Model. The template.yml
file in the root folder contains the application definition.
In a shell, navigate to the sample's folder and run the following command
$ gradle wrapper
In a shell, navigate to the sample's folder and use the SAM CLI to build a deployable package
$ sam build
This command compiles the application and prepares a deployment package in the .aws-sam
sub-directory.
To deploy the application in your AWS account, you can use the SAM CLI's guided deployment process and follow the instructions on the screen
$ sam deploy --guided
Once the deployment is completed, the SAM CLI will print out the stack's outputs, including the new application URL. You can use curl
or a web browser to make a call to the URL
...
---------------------------------------------------------------------------------------------------------
OutputKey-Description OutputValue
---------------------------------------------------------------------------------------------------------
PetStoreApi - URL for application https://xxxxxxxxxx.execute-api.us-west-2.amazonaws.com/pets
---------------------------------------------------------------------------------------------------------
$ curl https://xxxxxxxxxx.execute-api.us-west-2.amazonaws.com/pets