Slide 1

Slide 1 text

(without introducing more risk) Serverless, not infrastructureless Puppet Gareth Rushgrove More than just functions, unfortunately

Slide 2

Slide 2 text

(without introducing more risk) @garethr

Slide 3

Slide 3 text

(without introducing more risk) Gareth Rushgrove

Slide 4

Slide 4 text

(without introducing more risk) (as a service) Just add function

Slide 5

Slide 5 text

Replacing cron jobs with Lambda Gareth Rushgrove

Slide 6

Slide 6 text

(without introducing more risk) Gareth Rushgrove Clojure hello world (ns net.morethanseven.hello (:gen-class :implements [com.amazonaws.services.lambda.runtime.RequestStreamHandler]) (:require [clojure.java.io :as io] [clojure.string :as str]) (:import (com.amazonaws.services.lambda.runtime Context))) (defn -handleRequest [this input-stream output-stream context] (let [handle (io/writer output-stream)] (.write handle (str "hello" "world")) (.flush handle)))

Slide 7

Slide 7 text

(without introducing more risk) Gareth Rushgrove Javascript hello world exports.myHandler = function(event, context, callback) { callback(null, "Hello World"); }

Slide 8

Slide 8 text

(without introducing more risk) Sorry, I couldn’t resist Not so faas(t)

Slide 9

Slide 9 text

(without introducing more risk) Gareth Rushgrove Some required configuration… variable "aws_region" { description = "AWS Region Lambda function is deployed to" } variable "apex_environment" { description = "Apex configured environment. Auto provided by 'apex infra'" } variable "apex_function_role" { description = "Provisioned Lambda Role ARN via Apex. Auto provided by 'apex i } variable "apex_function_hub" { description = "Provisioned function 'hub' ARN information. Auto provided by ' } variable "apex_function_hub_name" { description = "Provisioned function 'hub' name information. Auto provided by }

Slide 10

Slide 10 text

(without introducing more risk) Gareth Rushgrove …some more required configuration resource "aws_cloudwatch_event_rule" "every_five_minutes" { name = "every-five-minutes" description = "Fires every five minutes" schedule_expression = "rate(5 minutes)" } resource "aws_cloudwatch_event_target" "check_hub_every_five_minutes" { rule = "${aws_cloudwatch_event_rule.every_five_minutes.name}" target_id = "${var.apex_function_hub_name}" arn = "${var.apex_function_hub}" } resource "aws_lambda_permission" "allow_cloudwatch_to_call_hub" { statement_id = "AllowExecutionFromCloudWatch" action = "lambda:InvokeFunction" function_name = "${var.apex_function_hub_name}" principal = "events.amazonaws.com"

Slide 11

Slide 11 text

For the 3 line Javascript function we needed 32 lines of configuration Gareth Rushgrove

Slide 12

Slide 12 text

I had to care about CloudWatch event targets, event rules and Lambda permissions, all of which are platform specific Gareth Rushgrove

Slide 13

Slide 13 text

A real world example from Serverless Gareth Rushgrove

Slide 14

Slide 14 text

(without introducing more risk) Gareth Rushgrove and more different configuration "EbsBackupSnapper": { "Type": "AWS::Lambda::Function", "DependsOn": [ "EbsBackupExecutionRole", "EbsBackupExecutionPolicy" ], "Properties": { "Code": { "S3Bucket": "demos.serverlesscode.com", "S3Key": "2015-11-ebs-snapshots/ebs-snapper.zip" }, "Role": { "Fn::GetAtt": ["EbsBackupExecutionRole", "Arn"] }, "Timeout": 60, "Handler": "lambda_function.lambda_handler", "Runtime": "python2.7",

Slide 15

Slide 15 text

For the 33 line Python function we needed 100 lines of configuration Gareth Rushgrove

Slide 16

Slide 16 text

I had to care about IAM policies and roles, which again are platform specific Gareth Rushgrove

Slide 17

Slide 17 text

(without introducing more risk) All the configuration Imagine

Slide 18

Slide 18 text

Running the same function on multiple platforms? Gareth Rushgrove

Slide 19

Slide 19 text

Multiple functions doing similar things? Gareth Rushgrove

Slide 20

Slide 20 text

infrastructure /ˈɪnfrəstrʌktʃə/ noun 1. the installations that form the basis for any operation or system Gareth Rushgrove

Slide 21

Slide 21 text

Removing servers doesn’t appear to have removed the need for infrastructure Gareth Rushgrove

Slide 22

Slide 22 text

(without introducing more risk) If all you remember is Conclusions

Slide 23

Slide 23 text

Will all serverless developers write the functions and associated configuration? Gareth Rushgrove

Slide 24

Slide 24 text

(without introducing more risk) Gareth Rushgrove Do we need better abstractions? */5 * * * * node /home/garethr/hello.js

Slide 25

Slide 25 text

Will we need people who specialise in the configuration of serverless systems? Gareth Rushgrove

Slide 26

Slide 26 text

Maybe we’ll call those people Systems Administrators Gareth Rushgrove

Slide 27

Slide 27 text

(without introducing more risk) Thanks for listening Find me later for questions