SlideShare uma empresa Scribd logo
1 de 39
Baixar para ler offline
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Earn Your DevOps Black Belt:
Deployment Scenarios with AWS
CloudFormation
Luis Colon
Sr. Developer Advocate
AWS CloudFormation
D E V 3 0 8
Chuck Meyer
Sr. Developer Advocate
AWS CloudFormation
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Agenda
CI/CD for infrastructure
Building an infrastructure pipeline
Testing and validation
Full Stack deployment examples
Serverless deployment
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS CloudFormation at a glance
Code in YAML or
JSON directly or use
sample templates
Upload local
files or from
an S3 bucket
Create stack
using console,
API or CLI
Stacks and
resources are
provisioned
Enables provisioning and management of your
infrastructure as code
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Release processes for code
Source Build Test Promote
Continuous integration
Continuous delivery
Continuous deployment
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Infrastructure as is code!
Source
Version control all templates and
configuration
Build Static analysis and unit tests
Test Clean environment for integration testing
Promote Deployment to live environments
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Version control everything
• Templates
• Parameter files
• Helper scripts
• Configuration files
Source
(Version controlled!)
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Static Analysis
• Run in a build tool or even a AWS Lambda function
• Validate syntax: cfn-lint
• Validate governance/business logic: cfn_nag
• Fail build and notify on errors
Build
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Cfn-lint results
> cfn-lint bad-route-table-association.yaml
E3022 SubnetId in AuxiliaryPublicSubnetRouteTableAssociation1 is
also associated with PublicSubnetRouteTableAssociation1
bad-route-table-association.yaml:24:9
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Integration testing
• Catch problems that aren’t obvious in a single template/stack
• TaskCat tests your templates by creating a stack in multiple regions
simultaneously
• Generates a report with a pass/fail grade for each region
Test
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
TaskCat results
·[0;37;44m[taskcat]·[0m |GENERATING REPORTS·[1;41;0m
·[0;30;43m[INFO ]·[0m :Creating report in [taskcat_outputs]
·[0;30;43m[INFO ]·[0m :Collecting CloudFormation Logs
·[0;30;43m[INFO ]·[0m :Collecting logs for tCaT-tag-vpc-test-889778e5"
|StackName: tCaT-tag-vpc-test-889778e5
|Region: us-east-2
|Logging to: taskcat_outputs/tCaT-tag-vpc-test-889778e5-us-east-2-cfnlogs.txt
|Tested on: Wednesday, 31. October 2018 02:45PM
--------------------------------------------------------------------------------------
ResourceStatusReason:
Stack launch was successful
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Deploy to all environments
• Create stacks in each environment, validate, continue
• Decide on a deployment strategy: Blue/Green, In-place, etc.
• Use an orchestration tool to ensure consistent deployment
• Use stack sets for deployment to multiple accounts & regions
• Insert approval stages if needed
Promote
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Build Test Promote
Infrastructure CI/CD – SaaS Tools
AWS Cloud
Region
Developers
Git Push
Templates Taskcat
Source
Staging
Production
Testing Change set
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Infrastructure CI/CD – DIY Tools
AWS Cloud
Region
Developers
Git Push
Templates
Staging
Production
Testing
VPC
Test PromoteSource Build
Change set
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Full stack deployment
{
{
{
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Full stack deployment – Amazon EC2
{
{
{ VPC
AZ1 AZ1
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Full stack deployment – Containers
{ VPC
AZ1 AZ1
Django MySQL
{
{
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Full stack deployment – serverless
{
{
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Full stack deployment – strategies
• Group resources by lifecycle
• Separate longer lived resources from ephemeral resources
• Isolate stateful resources
Auto Scaling
AMI
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon EC2 – Two Pipelines
Infrastructure (monthly) Application (daily)
VPC
AZ1 AZ1 AZ1 AZ1
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Build Test Promote
Amazon EC2 – Infrastructure CI/CD
AWS Cloud
Region
Developers
Git Push
Templates Taskcat
Source
Staging
Production
Testing
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Build Test Promote
Amazon EC2 – Application CI/CD
AWS Cloud
Region
Developers
Git Push
Source
Staging
Production
Application
Code
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Container pipeline
Environment Service
VPC
AZ1 AZ1
Container 1
Container 1
Templates Templates
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Build Test Promote
Container full stack CI /CD
AWS Cloud
Region
Developers
Acceptance
Production
Testing
Source
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Container based microservice management
• Mu is an open source tool released by Stelligent
• Full-stack microservice management
• Constructs pipelines, deploys services, manages environments
• Uses native services (AWS CodePipeline, AWS CodeBuild, AWS
CloudFormation)
https://getmu.io/
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS Serverless Application Model (SAM)
AWS CloudFormation extension optimized for
serverless
New serverless resource types: functions, APIs,
and tables
Supports anything AWS CloudFormation
supports
Open specification (Apache 2.0)
- SAM Translator recently open sourced!
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
SAM template for a custom resource
AWSTemplateFormatVersion: '2010-09-09'
Transform: 'AWS::Serverless-2016-10-31'
Description: Looks up the latest AMI ID for a given region and architecture.
Resources:
cfnlookupamiids:
Type: 'AWS::Serverless::Function'
Properties:
Handler: index.handler
Runtime: nodejs8.10
CodeUri: .
Description: Looks up the latest AMI ID for a given region and architecture.
MemorySize: 128
Timeout: 3
Policies:
- AMIDescribePolicy: {}
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Build Test Promote
Serverless deployment CI /CD with SAM
AWS Cloud
Region
Developers
Acceptance
Production
Testing
Source
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Takeaways
• Treat infrastructure definitions as code
• Version control everything
• Test everything
• Group resources by lifecycle (persistent vs. application)
• Deploy it all via pipeline(s)
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Tools we mentioned
cfn-lint https://git.io/vhGFK
cfn_nag https://git.io/fpe1K
taskcat https://git.io/fpe1X
mu https://git.io/fA7Tl
SAM CLI https://git.io/fpe1H
Thank you!
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Luis Colon
licolon@amazon.com
@luiscolon1
Chuck Meyer
cmmeyer@amazon.com
@chuckm
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Mais conteúdo relacionado

Mais procurados

Mais procurados (20)

Studio in the Cloud: Producing Content on AWS (MAE202) - AWS re:Invent 2018
Studio in the Cloud: Producing Content on AWS (MAE202) - AWS re:Invent 2018Studio in the Cloud: Producing Content on AWS (MAE202) - AWS re:Invent 2018
Studio in the Cloud: Producing Content on AWS (MAE202) - AWS re:Invent 2018
 
Achieving Business Value with AWS (ENT203-R2) - AWS re:Invent 2018
Achieving Business Value with AWS (ENT203-R2) - AWS re:Invent 2018Achieving Business Value with AWS (ENT203-R2) - AWS re:Invent 2018
Achieving Business Value with AWS (ENT203-R2) - AWS re:Invent 2018
 
All About the Customer: GraphQL & Real-Time Subscriptions in Customer Service...
All About the Customer: GraphQL & Real-Time Subscriptions in Customer Service...All About the Customer: GraphQL & Real-Time Subscriptions in Customer Service...
All About the Customer: GraphQL & Real-Time Subscriptions in Customer Service...
 
Driving DevOps Transformation in Enterprises (DEV320) - AWS re:Invent 2018
Driving DevOps Transformation in Enterprises (DEV320) - AWS re:Invent 2018Driving DevOps Transformation in Enterprises (DEV320) - AWS re:Invent 2018
Driving DevOps Transformation in Enterprises (DEV320) - AWS re:Invent 2018
 
使用 AWS Step Functions 靈活調度 AWS Lambda (Level:200)
使用 AWS Step Functions 靈活調度 AWS Lambda (Level:200)使用 AWS Step Functions 靈活調度 AWS Lambda (Level:200)
使用 AWS Step Functions 靈活調度 AWS Lambda (Level:200)
 
Container Power Hour with Jess, Clare, and Abby (CON362) - AWS re:Invent 2018
Container Power Hour with Jess, Clare, and Abby (CON362) - AWS re:Invent 2018Container Power Hour with Jess, Clare, and Abby (CON362) - AWS re:Invent 2018
Container Power Hour with Jess, Clare, and Abby (CON362) - AWS re:Invent 2018
 
Compliance and Security Mitigation Techniques
Compliance and Security Mitigation TechniquesCompliance and Security Mitigation Techniques
Compliance and Security Mitigation Techniques
 
Deploy Alexa for Business in Your Organization & Build Your First Private Ski...
Deploy Alexa for Business in Your Organization & Build Your First Private Ski...Deploy Alexa for Business in Your Organization & Build Your First Private Ski...
Deploy Alexa for Business in Your Organization & Build Your First Private Ski...
 
[NEW LAUNCH!] Introducing Amazon Elastic Inference: Reduce Deep Learning Infe...
[NEW LAUNCH!] Introducing Amazon Elastic Inference: Reduce Deep Learning Infe...[NEW LAUNCH!] Introducing Amazon Elastic Inference: Reduce Deep Learning Infe...
[NEW LAUNCH!] Introducing Amazon Elastic Inference: Reduce Deep Learning Infe...
 
The New Normal for Mission-Critical SAP Workloads (ENT219-R1) - AWS re:Invent...
The New Normal for Mission-Critical SAP Workloads (ENT219-R1) - AWS re:Invent...The New Normal for Mission-Critical SAP Workloads (ENT219-R1) - AWS re:Invent...
The New Normal for Mission-Critical SAP Workloads (ENT219-R1) - AWS re:Invent...
 
Building BMW Group's Customer Engagement Platform on AWS (AMT305) - AWS re:In...
Building BMW Group's Customer Engagement Platform on AWS (AMT305) - AWS re:In...Building BMW Group's Customer Engagement Platform on AWS (AMT305) - AWS re:In...
Building BMW Group's Customer Engagement Platform on AWS (AMT305) - AWS re:In...
 
AWS Storage Leadership Session: What's New in Amazon S3, Amazon EFS, Amazon E...
AWS Storage Leadership Session: What's New in Amazon S3, Amazon EFS, Amazon E...AWS Storage Leadership Session: What's New in Amazon S3, Amazon EFS, Amazon E...
AWS Storage Leadership Session: What's New in Amazon S3, Amazon EFS, Amazon E...
 
Announcing AWS RoboMaker: A New Cloud Robotics Service (ROB201-R) - AWS re:In...
Announcing AWS RoboMaker: A New Cloud Robotics Service (ROB201-R) - AWS re:In...Announcing AWS RoboMaker: A New Cloud Robotics Service (ROB201-R) - AWS re:In...
Announcing AWS RoboMaker: A New Cloud Robotics Service (ROB201-R) - AWS re:In...
 
Operationalizing Microsoft Workloads (WIN320) - AWS re:Invent 2018
Operationalizing Microsoft Workloads (WIN320) - AWS re:Invent 2018Operationalizing Microsoft Workloads (WIN320) - AWS re:Invent 2018
Operationalizing Microsoft Workloads (WIN320) - AWS re:Invent 2018
 
Designing for Operability: Getting the Last Nines in Five-Nines Availability ...
Designing for Operability: Getting the Last Nines in Five-Nines Availability ...Designing for Operability: Getting the Last Nines in Five-Nines Availability ...
Designing for Operability: Getting the Last Nines in Five-Nines Availability ...
 
How to Use Predictive Scaling (API331-R1) - AWS re:Invent 2018
How to Use Predictive Scaling (API331-R1) - AWS re:Invent 2018How to Use Predictive Scaling (API331-R1) - AWS re:Invent 2018
How to Use Predictive Scaling (API331-R1) - AWS re:Invent 2018
 
Deploy Serverless Apps with Python: AWS Chalice Deep Dive (DEV427-R2) - AWS r...
Deploy Serverless Apps with Python: AWS Chalice Deep Dive (DEV427-R2) - AWS r...Deploy Serverless Apps with Python: AWS Chalice Deep Dive (DEV427-R2) - AWS r...
Deploy Serverless Apps with Python: AWS Chalice Deep Dive (DEV427-R2) - AWS r...
 
“Cloud First” Helps Hub Intl Grow the Business with Splunk on AWS (ANT330-S) ...
“Cloud First” Helps Hub Intl Grow the Business with Splunk on AWS (ANT330-S) ...“Cloud First” Helps Hub Intl Grow the Business with Splunk on AWS (ANT330-S) ...
“Cloud First” Helps Hub Intl Grow the Business with Splunk on AWS (ANT330-S) ...
 
Run Your CI/CD and Test Workloads for 90% Less with Amazon EC2 Spot Instances...
Run Your CI/CD and Test Workloads for 90% Less with Amazon EC2 Spot Instances...Run Your CI/CD and Test Workloads for 90% Less with Amazon EC2 Spot Instances...
Run Your CI/CD and Test Workloads for 90% Less with Amazon EC2 Spot Instances...
 
Operations for Containerized Applications (CON334-R1) - AWS re:Invent 2018
Operations for Containerized Applications (CON334-R1) - AWS re:Invent 2018Operations for Containerized Applications (CON334-R1) - AWS re:Invent 2018
Operations for Containerized Applications (CON334-R1) - AWS re:Invent 2018
 

Semelhante a Earn Your DevOps Black Belt: Deployment Scenarios with AWS CloudFormation (DEV308-R1) - AWS re:Invent 2018

CI-CD with AWS Developer Tools and Fargate_AWSPSSummit_Singapore
CI-CD with AWS Developer Tools and Fargate_AWSPSSummit_SingaporeCI-CD with AWS Developer Tools and Fargate_AWSPSSummit_Singapore
CI-CD with AWS Developer Tools and Fargate_AWSPSSummit_Singapore
Amazon Web Services
 

Semelhante a Earn Your DevOps Black Belt: Deployment Scenarios with AWS CloudFormation (DEV308-R1) - AWS re:Invent 2018 (20)

Assembling an AWS CloudFormation Authoring Tool Chain (DEV368-R2) - AWS re:In...
Assembling an AWS CloudFormation Authoring Tool Chain (DEV368-R2) - AWS re:In...Assembling an AWS CloudFormation Authoring Tool Chain (DEV368-R2) - AWS re:In...
Assembling an AWS CloudFormation Authoring Tool Chain (DEV368-R2) - AWS re:In...
 
Control for Your Cloud Environment Using AWS Management Tools (ENT226-R1) - A...
Control for Your Cloud Environment Using AWS Management Tools (ENT226-R1) - A...Control for Your Cloud Environment Using AWS Management Tools (ENT226-R1) - A...
Control for Your Cloud Environment Using AWS Management Tools (ENT226-R1) - A...
 
Ci/CD for AWS Lambda Projects - JLM CTO Club
Ci/CD for AWS Lambda Projects - JLM CTO ClubCi/CD for AWS Lambda Projects - JLM CTO Club
Ci/CD for AWS Lambda Projects - JLM CTO Club
 
Devops on serverless
Devops on serverlessDevops on serverless
Devops on serverless
 
Build CICD Pipeline for Container Presentation Slides
Build CICD Pipeline for Container Presentation SlidesBuild CICD Pipeline for Container Presentation Slides
Build CICD Pipeline for Container Presentation Slides
 
Set Up a CI/CD Pipeline for Deploying Containers Using the AWS Developer Tool...
Set Up a CI/CD Pipeline for Deploying Containers Using the AWS Developer Tool...Set Up a CI/CD Pipeline for Deploying Containers Using the AWS Developer Tool...
Set Up a CI/CD Pipeline for Deploying Containers Using the AWS Developer Tool...
 
CI/CD with AWS Developer Tools and Fargate
CI/CD with AWS Developer Tools and FargateCI/CD with AWS Developer Tools and Fargate
CI/CD with AWS Developer Tools and Fargate
 
Ensuring Your Windows Server Workloads Are Well-Architected - AWS Online Tech...
Ensuring Your Windows Server Workloads Are Well-Architected - AWS Online Tech...Ensuring Your Windows Server Workloads Are Well-Architected - AWS Online Tech...
Ensuring Your Windows Server Workloads Are Well-Architected - AWS Online Tech...
 
PaaS – From Code to Running Application using AWS Elastic Beanstalk (DEV323) ...
PaaS – From Code to Running Application using AWS Elastic Beanstalk (DEV323) ...PaaS – From Code to Running Application using AWS Elastic Beanstalk (DEV323) ...
PaaS – From Code to Running Application using AWS Elastic Beanstalk (DEV323) ...
 
CI/CD for AWS Lambda Projects - IsraelCloud Meetup
CI/CD for AWS Lambda Projects - IsraelCloud MeetupCI/CD for AWS Lambda Projects - IsraelCloud Meetup
CI/CD for AWS Lambda Projects - IsraelCloud Meetup
 
Deep Dive on AWS CloudFormation
Deep Dive on AWS CloudFormationDeep Dive on AWS CloudFormation
Deep Dive on AWS CloudFormation
 
Serverless Application Debugging and Delivery Best Practices (DEV307-R1) - AW...
Serverless Application Debugging and Delivery Best Practices (DEV307-R1) - AW...Serverless Application Debugging and Delivery Best Practices (DEV307-R1) - AW...
Serverless Application Debugging and Delivery Best Practices (DEV307-R1) - AW...
 
Enabling Your Organization’s Amazon Redshift Adoption – Going from Zero to He...
Enabling Your Organization’s Amazon Redshift Adoption – Going from Zero to He...Enabling Your Organization’s Amazon Redshift Adoption – Going from Zero to He...
Enabling Your Organization’s Amazon Redshift Adoption – Going from Zero to He...
 
Build Modern Applications that Align with Twelve-Factor Methods (API303) - AW...
Build Modern Applications that Align with Twelve-Factor Methods (API303) - AW...Build Modern Applications that Align with Twelve-Factor Methods (API303) - AW...
Build Modern Applications that Align with Twelve-Factor Methods (API303) - AW...
 
CI CD using AWS Developer Tools @ AWS Community Day Bengaluru 2018
CI CD using AWS Developer Tools @ AWS Community Day Bengaluru 2018CI CD using AWS Developer Tools @ AWS Community Day Bengaluru 2018
CI CD using AWS Developer Tools @ AWS Community Day Bengaluru 2018
 
Deep Dive on Amazon Elastic Container Service (ECS) I AWS Dev Day 2018
Deep Dive on Amazon Elastic Container Service (ECS) I AWS Dev Day 2018Deep Dive on Amazon Elastic Container Service (ECS) I AWS Dev Day 2018
Deep Dive on Amazon Elastic Container Service (ECS) I AWS Dev Day 2018
 
Deploying Microservices using AWS Fargate (CON315-R1) - AWS re:Invent 2018
Deploying Microservices using AWS Fargate (CON315-R1) - AWS re:Invent 2018Deploying Microservices using AWS Fargate (CON315-R1) - AWS re:Invent 2018
Deploying Microservices using AWS Fargate (CON315-R1) - AWS re:Invent 2018
 
CI-CD with AWS Developer Tools and Fargate_AWSPSSummit_Singapore
CI-CD with AWS Developer Tools and Fargate_AWSPSSummit_SingaporeCI-CD with AWS Developer Tools and Fargate_AWSPSSummit_Singapore
CI-CD with AWS Developer Tools and Fargate_AWSPSSummit_Singapore
 
SRV313 Introduction to Building Web Apps on AWS
 SRV313 Introduction to Building Web Apps on AWS SRV313 Introduction to Building Web Apps on AWS
SRV313 Introduction to Building Web Apps on AWS
 
Infrastructure Security: Your Minimum Security Baseline
Infrastructure Security: Your Minimum Security BaselineInfrastructure Security: Your Minimum Security Baseline
Infrastructure Security: Your Minimum Security Baseline
 

Mais de Amazon Web Services

Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWS
Amazon Web Services
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch Deck
Amazon Web Services
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
Amazon Web Services
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
Amazon Web Services
 

Mais de Amazon Web Services (20)

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS Fargate
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWS
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot
 
Open banking as a service
Open banking as a serviceOpen banking as a service
Open banking as a service
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
 
Computer Vision con AWS
Computer Vision con AWSComputer Vision con AWS
Computer Vision con AWS
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatare
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e web
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWS
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch Deck
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
 
Fundraising Essentials
Fundraising EssentialsFundraising Essentials
Fundraising Essentials
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container Service
 

Earn Your DevOps Black Belt: Deployment Scenarios with AWS CloudFormation (DEV308-R1) - AWS re:Invent 2018

  • 1.
  • 2. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Earn Your DevOps Black Belt: Deployment Scenarios with AWS CloudFormation Luis Colon Sr. Developer Advocate AWS CloudFormation D E V 3 0 8 Chuck Meyer Sr. Developer Advocate AWS CloudFormation
  • 3. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Agenda CI/CD for infrastructure Building an infrastructure pipeline Testing and validation Full Stack deployment examples Serverless deployment
  • 4. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS CloudFormation at a glance Code in YAML or JSON directly or use sample templates Upload local files or from an S3 bucket Create stack using console, API or CLI Stacks and resources are provisioned Enables provisioning and management of your infrastructure as code
  • 5. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 6. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Release processes for code Source Build Test Promote Continuous integration Continuous delivery Continuous deployment
  • 7. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Infrastructure as is code! Source Version control all templates and configuration Build Static analysis and unit tests Test Clean environment for integration testing Promote Deployment to live environments
  • 8. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Version control everything • Templates • Parameter files • Helper scripts • Configuration files Source (Version controlled!)
  • 9. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Static Analysis • Run in a build tool or even a AWS Lambda function • Validate syntax: cfn-lint • Validate governance/business logic: cfn_nag • Fail build and notify on errors Build
  • 10. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Cfn-lint results > cfn-lint bad-route-table-association.yaml E3022 SubnetId in AuxiliaryPublicSubnetRouteTableAssociation1 is also associated with PublicSubnetRouteTableAssociation1 bad-route-table-association.yaml:24:9
  • 11. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Integration testing • Catch problems that aren’t obvious in a single template/stack • TaskCat tests your templates by creating a stack in multiple regions simultaneously • Generates a report with a pass/fail grade for each region Test
  • 12. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. TaskCat results ·[0;37;44m[taskcat]·[0m |GENERATING REPORTS·[1;41;0m ·[0;30;43m[INFO ]·[0m :Creating report in [taskcat_outputs] ·[0;30;43m[INFO ]·[0m :Collecting CloudFormation Logs ·[0;30;43m[INFO ]·[0m :Collecting logs for tCaT-tag-vpc-test-889778e5" |StackName: tCaT-tag-vpc-test-889778e5 |Region: us-east-2 |Logging to: taskcat_outputs/tCaT-tag-vpc-test-889778e5-us-east-2-cfnlogs.txt |Tested on: Wednesday, 31. October 2018 02:45PM -------------------------------------------------------------------------------------- ResourceStatusReason: Stack launch was successful
  • 13. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Deploy to all environments • Create stacks in each environment, validate, continue • Decide on a deployment strategy: Blue/Green, In-place, etc. • Use an orchestration tool to ensure consistent deployment • Use stack sets for deployment to multiple accounts & regions • Insert approval stages if needed Promote
  • 14. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Build Test Promote Infrastructure CI/CD – SaaS Tools AWS Cloud Region Developers Git Push Templates Taskcat Source Staging Production Testing Change set
  • 15. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Infrastructure CI/CD – DIY Tools AWS Cloud Region Developers Git Push Templates Staging Production Testing VPC Test PromoteSource Build Change set
  • 16. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 17. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 18. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Full stack deployment { { {
  • 19. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Full stack deployment – Amazon EC2 { { { VPC AZ1 AZ1
  • 20. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Full stack deployment – Containers { VPC AZ1 AZ1 Django MySQL { {
  • 21. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Full stack deployment – serverless { {
  • 22. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Full stack deployment – strategies • Group resources by lifecycle • Separate longer lived resources from ephemeral resources • Isolate stateful resources Auto Scaling AMI
  • 23. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 24. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon EC2 – Two Pipelines Infrastructure (monthly) Application (daily) VPC AZ1 AZ1 AZ1 AZ1
  • 25. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Build Test Promote Amazon EC2 – Infrastructure CI/CD AWS Cloud Region Developers Git Push Templates Taskcat Source Staging Production Testing
  • 26. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Build Test Promote Amazon EC2 – Application CI/CD AWS Cloud Region Developers Git Push Source Staging Production Application Code
  • 27. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 28. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Container pipeline Environment Service VPC AZ1 AZ1 Container 1 Container 1 Templates Templates
  • 29. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Build Test Promote Container full stack CI /CD AWS Cloud Region Developers Acceptance Production Testing Source
  • 30. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Container based microservice management • Mu is an open source tool released by Stelligent • Full-stack microservice management • Constructs pipelines, deploys services, manages environments • Uses native services (AWS CodePipeline, AWS CodeBuild, AWS CloudFormation) https://getmu.io/
  • 31. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 32. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 33. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS Serverless Application Model (SAM) AWS CloudFormation extension optimized for serverless New serverless resource types: functions, APIs, and tables Supports anything AWS CloudFormation supports Open specification (Apache 2.0) - SAM Translator recently open sourced!
  • 34. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. SAM template for a custom resource AWSTemplateFormatVersion: '2010-09-09' Transform: 'AWS::Serverless-2016-10-31' Description: Looks up the latest AMI ID for a given region and architecture. Resources: cfnlookupamiids: Type: 'AWS::Serverless::Function' Properties: Handler: index.handler Runtime: nodejs8.10 CodeUri: . Description: Looks up the latest AMI ID for a given region and architecture. MemorySize: 128 Timeout: 3 Policies: - AMIDescribePolicy: {}
  • 35. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Build Test Promote Serverless deployment CI /CD with SAM AWS Cloud Region Developers Acceptance Production Testing Source
  • 36. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Takeaways • Treat infrastructure definitions as code • Version control everything • Test everything • Group resources by lifecycle (persistent vs. application) • Deploy it all via pipeline(s)
  • 37. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Tools we mentioned cfn-lint https://git.io/vhGFK cfn_nag https://git.io/fpe1K taskcat https://git.io/fpe1X mu https://git.io/fA7Tl SAM CLI https://git.io/fpe1H
  • 38. Thank you! © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Luis Colon licolon@amazon.com @luiscolon1 Chuck Meyer cmmeyer@amazon.com @chuckm
  • 39. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.