AWS Lambda in Practice

Post on 05-Apr-2017

301 views 0 download

Transcript of AWS Lambda in Practice

λ in Practice or how i learned to stop worrying and love not having servers

@tobyhede

Toby Hede

OH HAI

100%

Technology LeadDigital Transformation OfficeTeh GOvernment

************

BackgroundWhat is it?

Why λ?

——————————————————————————————

All-of-Gov Performance Dashboard

Measure the performance of government services against metrics defined in the Digital Service Standard.

——————————————————————————————

All-of-Gov Performance Dashboard

Measure the performance of government services against metrics defined in the Digital Service Standard.

Drive the continuous improvement of government services for users and increase government transparency.

——————————————————————————————

Data๏ Multiple data sources๏ Disparate data sources๏ We don’t actually know what they all are yet๏ We don’t know how much of it we will have

Obligatory GIF

——————————————————————————————

Data๏ Connect all the moving pieces๏ Transform data from many different sources๏ Move fast๏ Adapt quickly

ArchitectureHow are we using λ?

——————————————————————————————

Caveats

We are just finishing AlphaProduction this week, pending approvalsGoing into Beta phaseExpanding our usage of λ

YOUR SHIPMENT OF CLOUD HAS ARRIVED

Serverless Framework

Configuration

Environments

Deployment

——————————————————————————————

Random Thoughts

Vendor Lock InDependenciesSecurityTestingWhat about other Amazon products and/or servicesZero infrastructure and a surprising amount of configuration

——————————————————————————————

Vendor Lock In• Meh

Businesswoman with question marks behind her, hard decision

What about vendor lock-in!!!!?

Convert to an express function

——————————————————————————————

An aside

——————————————————————————————

Security and IAM• AmazonAPIGatewayAdministrator• AWSLambdaFullAccess• AWSLambdaVPCAccessExecutionRole• ec2:DescribeSecurityGroups• ec2:DescribeSubnets• Built-in Serverless Policy

——————————————————————————————

Dependencies• Requires some planning• Nest packages with npm• Favour reimplementation of simple helpers rather

then pull in a dependency

——————————————————————————————

Testing• Unit test functions• If testing a function is hard, you are doing it wrong• ava is good• Can run Serverless locally using a plugin

——————————————————————————————

What about other AWS products• Possible for future development• We’ve played it safe on the database tier• Some limitations to what Gov can support• Contenders:

• Kinesis• Elastic search

——————————————————————————————

Configuration

Serverless means replying infrastructure with configurationDon’t underestimate the complexity

THE END

100%

@tobyhedetobyhede.com

************