Deployment automation for an AWS Serverless project: SAM vs - - PowerPoint PPT Presentation

deployment automation for an aws serverless
SMART_READER_LITE
LIVE PREVIEW

Deployment automation for an AWS Serverless project: SAM vs - - PowerPoint PPT Presentation

Deployment automation for an AWS Serverless project: SAM vs CloudFormation vs Terraform vs ServerlessFramework Bruno Amaro Almeida | 9 Sept 2019 @bruno_amaro Community Day 2019 Sponsors FUTURE. CO-CREATED. Nordic Roots, Global Mindset


slide-1
SLIDE 1

Deployment automation for an AWS Serverless project: SAM vs CloudFormation vs Terraform vs ServerlessFramework

Bruno Amaro Almeida | 9 Sept 2019 Community Day 2019 Sponsors @bruno_amaro
slide-2
SLIDE 2 He Helsinki Ta Tampere St Stockholm Os Oslo Lo London Be Berlin Mu Munich Nordic Roots, Global Mindset
  • FUTURE. CO-CREATED.
PEOPLE

550+

NATIONALITIES

38

OFFICES

8

YoY GROWTH

30%

Family of Companies eCommerce & Growth Hacking Artificial Intelligence & Machine Learning St Stuttgart
slide-3
SLIDE 3 B E R L I N · H E L S I N K I · L O N D O N · M U N I C H · O S L O · S T O C K H O L M · T A M P E R E Who is this guy? Pr Principal Ar Architect & Technology y Ad Advi visor @ Fu Futurice native, based in Cloud, DevOps, Security, Data Engineering & AI @brunoamaroalmeida @bruno_amaro Reach out on:  
slide-4
SLIDE 4 AUTOMATE AND DEPLOY (…) provisions your resources in a safe, repeatable manner, allowing you to build and rebuild your infrastructure and applications, without having to perform manual actions or write custom scripts. Why is Deployment Automation Important? source: aws.amazon.com REASONS FOR AUTOMATING INFRASTRUCTURE
  • Repeatable re-deployable infrastructure
  • Documented maintainable infrastructure
  • Scalable solutions
  • Huge Architectures
  • Complex systems
source: google cloud platform
slide-5
SLIDE 5 B E R L I N · H E L S I N K I · L O N D O N · M U N I C H · O S L O · S T O C K H O L M · T A M P E R E

[UNPOPULAR OPINION]: NOT EVERYTHING NEEDS TO BE AUTOMATED

Photo by Steve Johnson on Unsplash
slide-6
SLIDE 6 B E R L I N · H E L S I N K I · L O N D O N · M U N I C H · O S L O · S T O C K H O L M · T A M P E R E

A ”real-world" Serverless App

Fr Front ntend nd
  • 1 x Static Website:
  • Displays different options
  • Allows the visitor to select an option.
Ba Backend
  • 1 x API
  • Process the chosen option and stores the result.
slide-7
SLIDE 7 B E R L I N · H E L S I N K I · L O N D O N · M U N I C H · O S L O · S T O C K H O L M · T A M P E R E

A Serverless App

Wh What is is yo your fa favo vorite Ge German ca car br brand nd? ? Audi, Mercedes-Benz or BMW? Visit hello.devopssquad.com today 💛
slide-8
SLIDE 8

Architecture

@bruno_amaro
slide-9
SLIDE 9 Athena & QuickSight for Results @bruno_amaro
slide-10
SLIDE 10

AWS AWS CloudFormation provides a common language for you to describe and provision all the infrastructure resources in your cloud environment. CloudFormation allows you to use a simple text file to model and provision, in an automated and secure manner, all the resources needed for your applications across all regions and accounts. source: aws.amazon.com
slide-11
SLIDE 11 (optional) Pa Parame meters CloudFormation Re Resources (optional) Ou Outputs Other sections (optional): Tr Trans nsforms, , Ma Mappings, , Co Conditions, , et etc
slide-12
SLIDE 12

The AWS Se Serverless Application Model extends AWS CloudFormation to provide a simplified way of defining the Amazon API Gateway APIs, AWS Lambda functions, and Amazon DynamoDB tables needed by your serverless application.” source: aws.amazon.com
slide-13
SLIDE 13 Serverless Application Model AWS::IAM::Role AWS::Lambda::Function AWS::Lambda::Permission AWS::ApiGateway::RestApi AWS::ApiGateway::Resource AWS::ApiGateway::Method AWS::ApiGateway::Deployment AWS::ApiGateway::Stage AWS::ApiGateway::Method AWS::Serverless::Api (*) AWS::Serverless::Function AWS::ApiGateway::ApiKey AWS::ApiGateway::UsagePlan AWS::ApiGateway::UsagePlanKey AWS::ApiGateway::DomainName AWS::ApiGateway::BasePathMapping AWS::Route53::RecordSetGroup AWS::S3::Bucket AWS::S3::BucketPolicy Cl CloudFormation SA SAM @bruno_amaro
slide-14
SLIDE 14 Serverless Application Model
  • Zip the lambda dir & S3 upload
  • Outputs a new template file
( packaged.yaml )
  • Local debugging and
testing
  • Allow publishing to public
repository @bruno_amaro
slide-15
SLIDE 15

Te Terraform is a tool for building, changing, and versioning infrastructure safely and efficiently. Terraform can manage existing and popular service providers as well as custom in- house solutions.” source: terraform.io
slide-16
SLIDE 16 Terraform
  • Open Source project from Ha
Hashicorp
  • Multi-Cloud support (AWS, Azure, GCP, etc)
  • Multiple providers and services to be combined and composed
  • Separation between planning and execution phase
  • Module Registry
slide-17
SLIDE 17 Terraform Pl Plan In Init
slide-18
SLIDE 18 Terraform Ap Appl y (Optional) Ge Generate re resourc urce gr graph @bruno_amaro
slide-19
SLIDE 19

The Se Serverless Fr Fram amew ewor
  • rk
k helps you build serverless apps with radically less overhead and cost. It provides a powerful, unified experience to develop, deploy, test, secure and monitor your serverless applications. source: serverless.com
slide-20
SLIDE 20 Serverless Framework
  • Open Source project from Se
ServerlessFramework
  • Basic Multi-Cloud support (AWS, Azure, GCP, etc)
  • Focus on the core serverless components (e.g. API GW, Lambda, etc)
  • Ability to include Cloud Formation to extend the functionality
slide-21
SLIDE 21 Serverless Framework @bruno_amaro
slide-22
SLIDE 22 CloudFormation vs SAM vs Terraform vs ServerlessFramework Pr Pro:
  • AWS Native
  • Fully supported by
AWS
  • Free of charge
  • JSON or YAML
Co Con:
  • Hard to troubleshoot
¯\_( _(ツ)_ )_/¯
  • Not so easy to write
templates
  • Documentation is not
at a good level CloudFormation Ser erver erles ess Appl pplica cation Mod
  • del
Terraform Pr Pro:
  • Extension of AWS
CloudFormation
  • Ability to local debugging
and testing
  • Easier packaging
  • AWS SAM Repository
Co Con:
  • Only covers some AWS
Resources ¯\_( _(ツ)_ )_/¯
  • You still end up writting the
usual CF to workaround missing features Pr Pro
  • Open Source project from Hashicorp
  • Module Registry
  • Multiple providers can be combined
  • Multi-Cloud support (AWS, Azure, GCP, etc)
Co Con
  • Not AWS Native and Support is paid
  • Couple of workarounds here and there
¯\_( _(ツ)_ )_/¯
  • Multi-Cloud support
  • Resource Graphs
  • Separate planning and execution phase
  • Remote state files (chicken or the egg)
Serverless Framework Pr Pro
  • Open Source project from
ServerlessFramework
  • Easy to get up and running with
basic resources
  • Basic Multi-Cloud support (AWS,
Azure, GCP, etc) Co Con
  • Limited support (purely focused on
the traditional serverless resources) ¯\_( _(ツ)_ )_/¯
  • Two separate languages (ie. CF)
  • Agnostic infra tool ended up being a
JS project with 1000+ of frequently updating npm dependencies @bruno_amaro
slide-23
SLIDE 23 Thank you! Kiitos! Danke! Tack! B E R L I N · H E L S I N K I · L O N D O N · M U N I C H · O S L O · S T O C K H O L M · T A M P E R E Bruno Almeida PRINCIPAL ARCHITECT & TECHNOLOGY ADVISOR Cloud, Security, DevOps, Data Engineering & AI @brunoamaroalmeida @bruno_amaro Reach out on: