An Example API Using AWS Lambda + API Gateway Written In Scala
What Is This?
This is a fully working example of an API built with AWS Lambda + API Gateway (proxy integration) written in Scala. It is built ontop of aws-lambda4s which provides minimal boilerplate for making AWS Lamdba development pleasent in Scala.
Why Should I Use This?
By cloning this repo, you can get a fully working API using Lambda + API Gateway that you can run locally and deploy to AWS using a single command - in minutes.
More specifically, this repo gives you::
- All the boilerplate you need to get started writing AWS Lambda functions in Scala
- Automatic serialization of AWS Lambda's JSON input/output into nice Scala case classes
- Logging, it's already setup for you using AWS Lambda's custom log4j2 appender
- A complete CloudFormation template that allows you to run your Lambda locally or deploy it with a single command, using AWS's command line tools.
How Do I Get Started?
- Clone this repo
- Install the SAM cli tool
sbt assemblyto build your fat jar
sam local start-apito start the AWS lambda + API Gateway integration locally
- Run one of the test scripts, e.g.
- Modify as for your own project as you wish.
- When you're ready, deploy your project using sam, see here