Pro Yearly is on sale from $80 to $50! »

Serverless, not infrastructureless

Serverless, not infrastructureless

Talk from CloudCamp, about the reality of serverless, and some questions about the future of specialisation and systems administration.

98234c645fe8c935edc0fec0186d28b8?s=128

Gareth Rushgrove

July 06, 2017
Tweet

Transcript

  1. (without introducing more risk) Serverless, not infrastructureless Puppet Gareth Rushgrove

    More than just functions, unfortunately
  2. (without introducing more risk) @garethr

  3. (without introducing more risk) Gareth Rushgrove

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

  5. Replacing cron jobs with Lambda Gareth Rushgrove

  6. (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)))
  7. (without introducing more risk) Gareth Rushgrove Javascript hello world exports.myHandler

    = function(event, context, callback) { callback(null, "Hello World"); }
  8. (without introducing more risk) Sorry, I couldn’t resist Not so

    faas(t)
  9. (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 }
  10. (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"
  11. For the 3 line Javascript function we needed 32 lines

    of configuration Gareth Rushgrove
  12. I had to care about CloudWatch event targets, event rules

    and Lambda permissions, all of which are platform specific Gareth Rushgrove
  13. A real world example from Serverless Gareth Rushgrove

  14. (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",
  15. For the 33 line Python function we needed 100 lines

    of configuration Gareth Rushgrove
  16. I had to care about IAM policies and roles, which

    again are platform specific Gareth Rushgrove
  17. (without introducing more risk) All the configuration Imagine

  18. Running the same function on multiple platforms? Gareth Rushgrove

  19. Multiple functions doing similar things? Gareth Rushgrove

  20. infrastructure /ˈɪnfrəstrʌktʃə/ noun 1. the installations that form the basis

    for any operation or system Gareth Rushgrove
  21. Removing servers doesn’t appear to have removed the need for

    infrastructure Gareth Rushgrove
  22. (without introducing more risk) If all you remember is Conclusions

  23. Will all serverless developers write the functions and associated configuration?

    Gareth Rushgrove
  24. (without introducing more risk) Gareth Rushgrove Do we need better

    abstractions? */5 * * * * node /home/garethr/hello.js
  25. Will we need people who specialise in the configuration of

    serverless systems? Gareth Rushgrove
  26. Maybe we’ll call those people Systems Administrators Gareth Rushgrove

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

    for questions