Example project using the serverless.com framework that allows you to:
- Locally run a lambda fronted by a application load balancer so you can develop and test without deploying.
- Deploy that lambda and application load balancer, whole serverless.yml should JUST WORK, all you gotta do is add VPC and subnet details (your AWS account has a default one setup for you already).
This is still a work in progress, all feedback is welcome.
I've not found any examples that does these two things so I've made my own and leaving it here for you.
Come say hi on Twitter, I'm tmaslen.
Obvious fact: you need an AWS account for all this to work.
This is a list of everything you need before starting:
- VPC setup with two subnets.
- Local IAM account with the right amount of permissions given.
- Easiest way to do this is to give that account full access.
- You could use this list of permissions instead (this is probably wrong and so will update in future)
git clone git@github.com:tmaslen/serverless-local-alb-example.git
cd serverless-local-alb-example
npm install -g serverless
serverless offlinealb --function handler
- Check it out via
0.0.0.0:3000/
- Add your VPC and subnet ID values into the file
[config/serverless.config.yml](config/serverless.config.yml)
serverless deploy
- Check it out online