More Related Content Similar to Unlocking Agility with the AWS Serverless Application Model (SAM) - AWS Summit Sydney 2018 (20) More from Amazon Web Services (20) Unlocking Agility with the AWS Serverless Application Model (SAM) - AWS Summit Sydney 20181. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Gerardo Estaba
Solutions Architect, Amazon Web Services
Unlocking Agility With The AWS
Serverless Application Model (SAM)
2. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Pexels. https://creativecommons.org/publicdomain/zero/1.0/
Speed + Safety
3. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Jonny Lindner. https://creativecommons.org/publicdomain/zero/1.0/
4. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS CloudFormation
Declarative templates of your resources
Manages AWS resources based on dependencies
Manage with Source Control
5. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Meet
SAM!
6. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS Serverless Application Model (SAM)
CloudFormation extension optimised for serverless
Serverless resource types: functions, APIs, and tables plus
any resource CloudFormation supports
Supports parameters, mappings, outputs, global variables,
intrinsic functions, and some import values
https://github.com/awslabs/serverless-application-model
7. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWSTemplateFormatVersion: '2010-09-09’
Transform: AWS::Serverless-2016-10-31
Resources:
CalculatorAdd:
Type: AWS::Serverless::Function
Properties:
Handler: calculator
Runtime: go1.x
Events:
Add:
Type: Api
Properties:
Path: /
Method: get
SAM Template
8. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
SAM Template
AWSTemplateFormatVersion: '2010-09-09’
Transform: AWS::Serverless-2016-10-31
Resources:
CalculatorAdd:
Type: AWS::Serverless::Function
Properties:
Handler: calculator
Runtime: go1.x
Events:
Add:
Type: Api
Properties:
Path: /
Method: get
9. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Transformed Template
10. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
SAM Template
Lambda function
AWSTemplateFormatVersion: '2010-09-09’
Transform: AWS::Serverless-2016-10-31
Resources:
CalculatorAdd:
Type: AWS::Serverless::Function
Properties:
Handler: calculator
Runtime: go1.x
Events:
Add:
Type: Api
Properties:
Path: /
Method: get
11. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
SAM Template
API Gateway API
AWSTemplateFormatVersion: '2010-09-09’
Transform: AWS::Serverless-2016-10-31
Resources:
CalculatorAdd:
Type: AWS::Serverless::Function
Properties:
Handler: calculator
Runtime: go1.x
Events:
Add:
Type: Api
Properties:
Path: /
Method: get
12. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
SAM Commands: Easier Deployment
Package
•Creates a deployment package (.zip file)
•Uploads deployment package to an Amazon S3 Bucket
•Adds a CodeUri property with S3 URI
Deploy
•Calls CloudFormation ‘CreateChangeSet’ API
•Calls CloudFormation ‘ExecuteChangeSet’ API
13. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
1st Demo
AddingAPI
AWS Lambda
function
Amazon API
Gateway
{ 4, 3 } { 4, 3 }
{ 7 } { 7 }
14. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
SAM Summary
Less Code
Less Process (with SAM Commands)
Easy Safe Deployments for Lambda
via Canaries and blue|green
AWS CodeDeploy
15. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
What We Did…
Author Deploy TestWait…
16. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Better
Author Test Debug
Author/Test/Debug
CI/CD
Deploy
17. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
SAM Local
CLI tool for local test, debug and deploy serverless apps
Author Test Debug
Author/Test/Debug
CI/CD
Deploy
No Waiting
No Interruptions
No Internet
18. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Docker to mimic Lambda execution environment
Invoke Lambda functions locally
Start API Gateway locally
Mock event sources like S3, DDB, Kinesis, etc
Live debugging for Java, Node.js, and Python
https://github.com/awslabs/aws-sam-localnpm install sam-local
SAM Local
19. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
2nd Demo
{ 4, 3 }
{ 12 }
AddingAPI
AWS Lambda
function
Amazon API
Gateway
{ 4, 3 } { 4, 3 }
{ 7 } { 7 }
Multiply
AWS Lambda
function
20. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
SAM Local Summary: Faster Software Creation
Author Test Debug
Author/Test/Debug
CI/CD
Deploy
No Waiting
No Interruptions
No Internet
21. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Safe Deployments (APIGW) Summary
90%
10%
100%
Adding
AWS Lambda
function
Multiply
AWS Lambda
function
API
Amazon API
Gateway
22. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Pexels. https://creativecommons.org/publicdomain/zero/1.0/
Speed + Safety
23. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Gerhard Gellinger. https://creativecommons.org/publicdomain/zero/1.0/
Write anything serverless, anytime, anywhere.
24. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Write anything serverless,
anytime, anywhere.
Thank You