Best practices when working with the Serverless framework

ape.gs/SLS-AWS

Why this talk?

Issues when going serverless/adopting frameworks

Because we have all met this guy

Because we have all been burned by a framework

dev : prod parity

Because nobody knows what the future will hold

But we all want to play with new, shiny things

And of course, we want to be the one to herald a new age of "business agility"

NB: NOT GOOD FOR BACK OR PRODUCTIVITY

Best practices when adopting frameworks (and this time, the Serverless framework)

ape.gs/SLS-AWS

What are we building?

Memebot

  • list all available meme templates
  • search through existing meme templates
  • create a meme using an existing template
  • create a meme from a custom image url

Functionality

Memebot

  • Slack!
  • issue commands using a /memebot slash command

Interface

  1. Decouple our business logic from the serverless framework as much as possible
  2. Test our code rigorously to prove Mr. "I need a Test Harness" wrong
  3. Get a decent development environment going to address factor the dev/prod parity issue!

GOALS

Demo

Adopting Serverless

Start with a fresh project

  • Treat your first Serverless project as a tech spike
  • Team needs to know:
    • Experimentation is the goal
    • Failure is OK
  • Pick a project without specific latency requirements
  • Ideally first build something new, rather than refactoring something that exists (don't associate problems with your existing tech debt with Serverless architectures)

USE DEPENDENCY INJECTION

  • Finding the right framework is like dating.  Don't marry at first sight.
  • DI Containers will help make your business logic more portable
  • Partially isolates against big breaking changes in the underlying framework (classic framework move)

Same SDLC as any other project

  • People love familiarity
  • Developers want the SDLC to be the same as every other project
  • Maintain same CI/CD workflows / tooling
  • Maintain the same QA processes

Don't forget about security

  • A lambda without a VPC is the ideal because it only needs a properly configured IAM policy
  • All but the simplest applications will still need a VPC, so EC2 networking security architecture remains important (security groups, public/private subnets, ACLs, etc)
  • Leverage Lambda options to associate some Lambda functions to your VPCs with DBs and resources in private subnets

Thank you!

ape.gs/SLS-AWS

Best Practices When Going Serverless (Chris)

By em0ney

Best Practices When Going Serverless (Chris)

Best practices when diving into the serverless framework

  • 859