Slide 1

Slide 1 text

© 2019, Amazon Web Services, Inc. or its Affiliates. Danilo Poccia Principal Evangelist, Serverless @danilop Simplifying Serverless CI/CD

Slide 2

Slide 2 text

How does Serverless work? Photo by Mervyn Chan on Unsplash

Slide 3

Slide 3 text

© 2019, Amazon Web Services, Inc. or its Affiliates. How does Serverless work? Storage Databases Analytics Machine Learning . . . Your unique business logic User uploads a picture Customer data updated Anomaly detected API call . . . Fully-managed services Events Functions

Slide 4

Slide 4 text

© 2019, Amazon Web Services, Inc. or its Affiliates. Photo by Oskars Sylwan on Unsplash Focus on what you want to build, not the nuts & bolts required by the implementation of the solution

Slide 5

Slide 5 text

© 2019, Amazon Web Services, Inc. or its Affiliates. Photo by Scott Blake on Unsplash What can we build?

Slide 6

Slide 6 text

SCALING CHALLENGES 350 DONATIONS PER SECOND Case Study

Slide 7

Slide 7 text

OLD VS NEW March 2019 cost* $5,393 March 2015 cost* $83,908 *All hosting costs are paid for through corporate partnerships. 100% of public donations go to the projects we fund. Case Study

Slide 8

Slide 8 text

WE COULD DO IT ALL AGAIN TOMORROW Serverless services cost $92 Case Study

Slide 9

Slide 9 text

© 2019, Amazon Web Services, Inc. or its Affiliates. Photo by Samuele Errico Piccarini on Unsplash

Slide 10

Slide 10 text

© 2019, Amazon Web Services, Inc. or its Affiliates. AWS Serverless Application Model (SAM) AWSTemplateFormatVersion: '2010-09-09’ Transform: AWS::Serverless-2016-10-31 Resources: GetFunction: Type: AWS::Serverless::Function Properties: Handler: index.get Runtime: nodejs8.10 CodeUri: src/ Policies: - DynamoDBReadPolicy: TableName: !Ref MyTable Events: GetResource: Type: Api Properties: Path: /resource/{resourceId} Method: get MyTable: Type: AWS::Serverless::SimpleTable Just 20 lines to create: • Lambda function • IAM role • API Gateway • DynamoDB table O pen Source

Slide 11

Slide 11 text

© 2019, Amazon Web Services, Inc. or its Affiliates. SAM CLI pip install --user aws-sam-cli # use native Linux/Windows/macOS installers sam init # interactive or with args e.g. --name my-app --runtime python cd my-app/ sam local ... # generate-event/invoke/start-api/start-lambda sam validate # The SAM template sam build # Depending on the runtime sam package --s3-bucket my-packages-bucket \ --output-template-file packaged.yaml sam deploy --template-file packaged.yaml \ --stack-name my-stack-prod sam logs -n MyFunction --stack-name my-stack-prod -t # Tail sam publish # To the Serverless Application Repository O pen Source CodePipeline Use CloudFormation deployment actions with any SAM application Jenkins Use SAM CLI plugin

Slide 12

Slide 12 text

© 2019, Amazon Web Services, Inc. or its Affiliates. Safe deployments in SAM Resources: GetFunction: Type: AWS::Serverless::Function Properties: AutoPublishAlias: live DeploymentPreference: Type: Canary10Percent5Minutes Alarms: - !Ref ApiErrorsAlarm - !Ref ApiLatencyAlarm Hooks: PreTraffic: !Ref PreTrafficLambdaFunction PostTraffic: !Ref PreTrafficLambdaFunction Canary10Percent30Minutes Canary10Percent5Minutes Canary10Percent10Minutes Canary10Percent15Minutes Linear10PercentEvery10Minutes Linear10PercentEvery1Minute Linear10PercentEvery2Minutes Linear10PercentEvery3Minutes AllAtOnce + Custom Deployment Configurations

Slide 13

Slide 13 text

© 2019, Amazon Web Services, Inc. or its Affiliates. Safe deployments in SAM Resources: GetFunction: Type: AWS::Serverless::Function Properties: AutoPublishAlias: live DeploymentPreference: Type: Canary10Percent5Minutes Alarms: - !Ref ApiErrorsAlarm - !Ref ApiLatencyAlarm Hooks: PreTraffic: !Ref PreTrafficLambdaFunction PostTraffic: !Ref PreTrafficLambdaFunction These can be CloudWatch anomaly detection alarms

Slide 14

Slide 14 text

© 2019, Amazon Web Services, Inc. or its Affiliates. Using CloudWatch Anomaly Detection Alarms

Slide 15

Slide 15 text

© 2019, Amazon Web Services, Inc. or its Affiliates. Editing the Anomaly Detection Model

Slide 16

Slide 16 text

Photo by J W on Unsplash Can we help more?

Slide 17

Slide 17 text

© 2019, Amazon Web Services, Inc. or its Affiliates. © 2019, Amazon Web Services, Inc. or its Affiliates.

Slide 18

Slide 18 text

No content

Slide 19

Slide 19 text

© 2019, Amazon Web Services, Inc. or its Affiliates. Photo by Kea Mowat on Unsplash Speed & Control

Slide 20

Slide 20 text

© 2019, Amazon Web Services, Inc. or its Affiliates. © 2019, Amazon Web Services, Inc. or its Affiliates. Thank you! @danilop Please give me your feedback