SlideShare a Scribd company logo
1 of 39
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
DevOps On AWS:
Advanced Techniques for Amazon EC2
Deployments on AWS
Balaji Iyer
Infrastructure Architect
AWS Professional Services
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
What we'll cover
• What is Continuous Deployment?
• Deployment Approaches
• Blue-Green Deployment
• Red-Black Deployment
• Continuous Delivery Machine
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Continuous Delivery
(CD) is the extension of CI where teams ensure that every change to the
system is releasable and production ready, and that we can release any
version at the push of a button. Continuous Delivery aims to make releases
boring, so we can deliver frequently and get fast feedback on what end
users care about.
http://www.thoughtworks.com/continuous-delivery
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Continuous Delivery
Version
Control
CI Server
Package
Builder
Deploy
ServerCommit to
Git/master
Dev
Get /
Pull
Code
AMIs
Send Build Report to Dev
Stop everything if build failed
Distributed Builds
Run Tests in parallel
Staging Env
Test Env
Code
Config
Tests
Prod Env
Push
Config
Install
Create
Repo
CloudFormation
Templates for Env
Generate
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
• Automated, repeatable process to push changes to production
• Hardens, de-risks the deployment process
• Allows detection of failure as quickly as possible in the build process
• Supports A/B testing or “We test customer reactions to features in
production”
• Gives us a breadth of data points across our applications
What Does CD Give Us?
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Automated Testing
• Robust, automated testing drives confidence in the entire process
• Testing is not viewed as a “phase” of a project
- Testing starts on day one
• View failures as successes
• Don’t overlook testing the infrastructure
- Are you ready for the Simian Army?
• Testing is everyone’s responsibility
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Continuous Deployment
The ultimate culmination of this process; it is the actual delivery of features
and fixes to the customer as soon as they are ready. Essentially the release
of every commit directly to production as soon as possible. This provides the
maximum value to customers in that features are released as soon as they
are ready, and with the confidence that they have been tested thoroughly.
http://blogs.atlassian.com/2014/04/practical-continuous-deployment/
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Continuous Deployment
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Deployment Approaches
• Deploy in-place
- Deploy all at once (Service outage)
- Rolling updates
Demo
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Deployment Approaches
• Blue-Green Deployment
– Discrete environment
– Multiple environments from branches
– Support A/B testing
– “Rolling DNS”
• Alternate Blue-Green (Red-Black?) Deployment
– Attach and detach Auto Scaling groups from Elastic Load balancers
– Avoid messing with DNS
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Blue-Green Deployment
• Stand up duplicate
infrastructure and slowly
cut traffic over to it
- Shift via DNS
- Simplifies feature testing
- Simplifies roll back
• As we shift more traffic
over, let auto-scaling
grow/shrink our instances
- Shut down the old when no traffic there
Amazon
Route 53
EC2 Instances
ELB
100%
DynamoDB
MySQL RDS
Instance
ElastiCache
Cache Node
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Blue-Green Deployment
• Stand up duplicate
infrastructure and slowly
cut traffic over to it
- Shift via DNS
- Simplifies feature testing
- Simplifies roll back
• As we shift more traffic
over, let auto-scaling
grow/shrink our instances
- Shut down the old when no traffic there
Amazon
Route 53
EC2 Instances
ELB
EC2 Instances
ELB
90% 10%
DynamoDB
MySQL RDS
Instance
ElastiCache
Cache Node
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Blue-Green Deployment
• Stand up duplicate
infrastructure and slowly
cut traffic over to it
- Shift via DNS
- Simplifies feature testing
- Simplifies roll back
• As we shift more traffic
over, let auto-scaling
grow/shrink our instances
- Shut down the old when no traffic there
Amazon
Route 53
EC2 Instances
ELB
EC2 Instances
ELB
0% 100%
DynamoDB MySQL RDS
Instance
ElastiCache
Cache Node
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Blue-Green Deployment
• Stand up duplicate
infrastructure and slowly
cut traffic over to it
- Shift via DNS
- Simplifies feature testing
- Simplifies roll back
• As we shift more traffic
over, let auto-scaling
grow/shrink our instances
- Shut down the old when no traffic there
Amazon
Route 53
EC2 Instances
ELB
EC2 Instances
ELB
0% 100%
DynamoDB MySQL RDS
Instance
ElastiCache
Cache Node
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
ASG V1
ELB
Red-Black Deployment
RDS
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
ELB
ASG V1 ASG V2
UAT
RDS
Red-Black Deployment
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
ELB
ASG V1 ASG V2
RDS
Red-Black Deployment
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
ELB
RDS
ASG V2
Red-Black Deployment
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Timeline
V2.1
ID NAME ADDRESS ORDERID (Char)
23234 Joe Doe xxx 333424
45322 Rob Smith xxxx 234
2342342 Jane Smith xxxx 23424
2342265 Anne Lee xxxx 2342425
Dealing with databases example
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Timeline
DB
V1.1
V2.1
ID NAME ADDRESS ORDERID ORDERID_INT
23234 Joe Doe xxx 333424
45322 Rob Smith xxxx 234
2342342 Jane Smith xxxx 23424
2342265 Anne Lee xxxx 2342425
Dealing with databases example
• Add a New Column
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Deployment Timeline
DB
V1.1
V2.1
ID NAME ADDRESS ORDERID ORDERID_INT
23234 Joe Doe xxx 333424
45322 Rob Smith xxxx 234
2342342 Jane Smith xxxx 23424
2342265 Anne Lee xxxx 2342425
3632342 Mark Fox cxxxx 567890 567890
Dealing with databases example
• Add a New Column
• Change Apps to write to both new & old columns
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Deployment Timeline
DB
V1.1
V2.1
ID NAME ADDRESS ORDERID ORDERID_INT
23234 Joe Doe xxx 333424 333424
45322 Rob Smith xxxx 234 234
2342342 Jane Smith xxxx 23424 23424
2342265 Anne Lee xxxx 2342425 2342425
3632342 Mark Fox cxxxx 567890 567890
DB
V1.2
Dealing with databases example
• Add a New Column
• Change Apps to write to both new & old columns
• Migrate old column data to new column ( for older rows)
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Deployment Timeline
DB
V1.1
V2.1
ID NAME ADDRESS ORDERID ORDERID_INT
23234 Joe Doe xxx 333424 333424
45322 Rob Smith xxxx 234 234
2342342 Jane Smith xxxx 23424 23424
2342265 Anne Lee xxxx 2342425 2342425
3632342 Mark Fox cxxxx 567890 567890
DB
V1.2
V2.2
Dealing with databases example
• Add a New Column
• Change Apps to write to both new & old columns
• Migrate old column data to new column ( for older rows)
• Update all Apps to read from new column
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Deployment Timeline
DB
V1.1
V2.1
ID NAME ADDRESS ORDERID ORDERID_INT
23234 Joe Doe xxx 333424 333424
45322 Rob Smith xxxx 234 234
2342342 Jane Smith xxxx 23424 23424
2342265 Anne Lee xxxx 2342425 2342425
3632342 Mark Fox cxxxx 567890 567890
433453 Mark Lee cxxxxx 4352342422
DB
V1.2
V2.2 V2.3
Dealing with databases example
• Add a New Column
• Change Apps to write to both new & old
columns
• Migrate old column data to new column ( for
older rows)
• Update all Apps to read from new column
• Update all Apps to only write to new
column
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Deployment Timeline
DB
V1.1
V2.1
ID NAME ADDRESS ORDERID_INT
23234 Joe Doe xxx 333424
45322 Rob Smith xxxx 234
2342342 Jane Smith xxxx 23424
2342265 Anne Lee xxxx 2342425
3632342 Mark Fox cxxxx 567890
433453 Mark Lee cxxxxx 4352342422
DB
V1.2
V2.2 V2.3
DB
V1.3
Dealing with databases example
• Add a New Column
• Change Apps to write to both new & old
columns
• Migrate old column data to new column (
for older rows)
• Update all Apps to read from new column
• Update all Apps to only write to new
column
• Drop the old column
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
MonitorProvisionDeployTestBuildCode
Elastic Beanstalk
OpsWorks
Cloud
Watch
Cloud
Formation
Code
Deploy
Code
Commit
Code
Pipeline
AWS DevOps Aligned Services
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
EC2CloudFormationOpsWorksBeanstalk
Managed Deployment Do it Yourself
Convenience Control
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Build
CodeBuild
AWS CodeBuild
NotifyDevelopers
Lambda
TestAPI
Runscope
Sequential actions
Deploy
JavaApp
Elastic Beanstalk
Source
Source
GitHub
CodePipeline
MyApplication
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Build
CodeBuild
AWS CodeBuild
Staging-Deploy
JavaApp
Elastic Beanstalk
Prod-Deploy
JavaApp
Elastic Beanstalk
QATeamReview
Manual Approval
Manual Approvals
Review
CodePipeline
MyApplication
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Enabling Continuous Delivery
• Create repeatable patterns and standardized code elements that allow the
enablement of customizable parameterized deployment of entire stacks of
applications consistently to our specifications
• Build reliable shared services that enable quick adoption of repeatable patterns
for many diverse workloads and applications
• Provide a consistent set of coded artifacts that can serve to reduce the training,
documentation and ramp up costs across a large diverse development team
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Enabling Continuous Delivery
• The Continuous Delivery Machine
– Enables developers to use shared services and repeatable patterns to create
continuous delivery pipelines for their applications and workloads
• Continuous Delivery Pipeline
– A set of chained automation jobs constructed in phases that orchestrate the build,
deploy, test and monitoring of a set of applications or workloads
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Building a Continuous Delivery Machine
• Source Code Repository
• Continuous Integration System
• Infrastructure Provisioning System
• Configuration Management System
• Artifact Management System
• Cetralized Log Management System
• Monitoring and Feedback System
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Elements of a Continuous Delivery Pipeline
• Commit Phase
– Static code analysis
• Acceptance Phase
– Dynamic analysis
• Capacity Phase
– Load, performance and failover testing
• Exploratory Phase
– Penetration and experimental testing
• Production Phase
– Blue/Green Deployment
– Persistent data handling
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Automate Everything
• Automation is vital to smaller, more frequent releases
• All steps that add human intervention also add
fragility
- “Small compromises can undermine your success”
• Use knowledge gathered from frequent, automated
releases to constantly evolve the process
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
The Continuous Delivery Maturity Model
• Designed to allow for quick enablement of large teams to both create the
shared services required to enable Continuous Delivery as well as
development of application specific pipelines in concert
• Shared services are stood up just in time to allow application teams to
mature their pipeline development
• The Continuous Delivery System owners are 1 maturity level ahead of the
Pipeline owners
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
The Continuous Delivery Maturity Model
• Builds on Minimal Viable Product concepts to rapidly establish automated
deployment capability for many applications
• Enables large teams to start contributing quickly
• Creates functional systems layer that allows developers to quickly find
reusable patterns to apply to new workloads
• Allows visibility into how mature workloads are across the organization
• Can be measured to compare strategies for success
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
References
• Blue/Green Deployments on AWS Whitepaper:
– Overview, techniques, and best practices for implementing a Blue/Green deployment
strategy.
– https://d0.awsstatic.com/whitepapers/AWS_Blue_Green_Deployments.pdf
• CodeDeploy Tutorials:
– http://docs.aws.amazon.com/codedeploy/latest/userguide/tutorials.html
• Walkthroughs:
– http://docs.aws.amazon.com/codedeploy/latest/userguide/tutorials-github.html
• Workflows:
– http://docs.aws.amazon.com/codedeploy/latest/userguide/deployment-steps.html
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
THANK YOU
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved
?
https://secure.flickr.com/photos/dullhunk/202872717/

More Related Content

More from 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
 
Protect your applications from DDoS/BOT & Advanced Attacks
Protect your applications from DDoS/BOT & Advanced AttacksProtect your applications from DDoS/BOT & Advanced Attacks
Protect your applications from DDoS/BOT & Advanced Attacks
Amazon Web Services
 
Track 6 Session 6_ 透過 AWS AI 服務模擬、部署機器人於產業之應用
Track 6 Session 6_ 透過 AWS AI 服務模擬、部署機器人於產業之應用Track 6 Session 6_ 透過 AWS AI 服務模擬、部署機器人於產業之應用
Track 6 Session 6_ 透過 AWS AI 服務模擬、部署機器人於產業之應用
Amazon Web Services
 

More from Amazon Web Services (20)

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
 
Come costruire un'architettura Serverless nel Cloud AWS
Come costruire un'architettura Serverless nel Cloud AWSCome costruire un'architettura Serverless nel Cloud AWS
Come costruire un'architettura Serverless nel Cloud AWS
 
AWS Serverless per startup: come innovare senza preoccuparsi dei server
AWS Serverless per startup: come innovare senza preoccuparsi dei serverAWS Serverless per startup: come innovare senza preoccuparsi dei server
AWS Serverless per startup: come innovare senza preoccuparsi dei server
 
Crea dashboard interattive con Amazon QuickSight
Crea dashboard interattive con Amazon QuickSightCrea dashboard interattive con Amazon QuickSight
Crea dashboard interattive con Amazon QuickSight
 
Costruisci modelli di Machine Learning con Amazon SageMaker Autopilot
Costruisci modelli di Machine Learning con Amazon SageMaker AutopilotCostruisci modelli di Machine Learning con Amazon SageMaker Autopilot
Costruisci modelli di Machine Learning con Amazon SageMaker Autopilot
 
Migra le tue file shares in cloud con FSx for Windows
Migra le tue file shares in cloud con FSx for Windows Migra le tue file shares in cloud con FSx for Windows
Migra le tue file shares in cloud con FSx for Windows
 
La tua organizzazione è pronta per adottare una strategia di cloud ibrido?
La tua organizzazione è pronta per adottare una strategia di cloud ibrido?La tua organizzazione è pronta per adottare una strategia di cloud ibrido?
La tua organizzazione è pronta per adottare una strategia di cloud ibrido?
 
Protect your applications from DDoS/BOT & Advanced Attacks
Protect your applications from DDoS/BOT & Advanced AttacksProtect your applications from DDoS/BOT & Advanced Attacks
Protect your applications from DDoS/BOT & Advanced Attacks
 
Track 6 Session 6_ 透過 AWS AI 服務模擬、部署機器人於產業之應用
Track 6 Session 6_ 透過 AWS AI 服務模擬、部署機器人於產業之應用Track 6 Session 6_ 透過 AWS AI 服務模擬、部署機器人於產業之應用
Track 6 Session 6_ 透過 AWS AI 服務模擬、部署機器人於產業之應用
 

DevOps On AWS: Advanced Techniques for Amazon EC2 Deployments on AWS

  • 1. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved DevOps On AWS: Advanced Techniques for Amazon EC2 Deployments on AWS Balaji Iyer Infrastructure Architect AWS Professional Services
  • 2. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved What we'll cover • What is Continuous Deployment? • Deployment Approaches • Blue-Green Deployment • Red-Black Deployment • Continuous Delivery Machine
  • 3. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved Continuous Delivery (CD) is the extension of CI where teams ensure that every change to the system is releasable and production ready, and that we can release any version at the push of a button. Continuous Delivery aims to make releases boring, so we can deliver frequently and get fast feedback on what end users care about. http://www.thoughtworks.com/continuous-delivery
  • 4. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved Continuous Delivery Version Control CI Server Package Builder Deploy ServerCommit to Git/master Dev Get / Pull Code AMIs Send Build Report to Dev Stop everything if build failed Distributed Builds Run Tests in parallel Staging Env Test Env Code Config Tests Prod Env Push Config Install Create Repo CloudFormation Templates for Env Generate
  • 5. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved • Automated, repeatable process to push changes to production • Hardens, de-risks the deployment process • Allows detection of failure as quickly as possible in the build process • Supports A/B testing or “We test customer reactions to features in production” • Gives us a breadth of data points across our applications What Does CD Give Us?
  • 6. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved Automated Testing • Robust, automated testing drives confidence in the entire process • Testing is not viewed as a “phase” of a project - Testing starts on day one • View failures as successes • Don’t overlook testing the infrastructure - Are you ready for the Simian Army? • Testing is everyone’s responsibility
  • 7. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved Continuous Deployment The ultimate culmination of this process; it is the actual delivery of features and fixes to the customer as soon as they are ready. Essentially the release of every commit directly to production as soon as possible. This provides the maximum value to customers in that features are released as soon as they are ready, and with the confidence that they have been tested thoroughly. http://blogs.atlassian.com/2014/04/practical-continuous-deployment/
  • 8. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved Continuous Deployment
  • 9. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved Deployment Approaches • Deploy in-place - Deploy all at once (Service outage) - Rolling updates Demo
  • 10. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved Deployment Approaches • Blue-Green Deployment – Discrete environment – Multiple environments from branches – Support A/B testing – “Rolling DNS” • Alternate Blue-Green (Red-Black?) Deployment – Attach and detach Auto Scaling groups from Elastic Load balancers – Avoid messing with DNS
  • 11. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved Blue-Green Deployment • Stand up duplicate infrastructure and slowly cut traffic over to it - Shift via DNS - Simplifies feature testing - Simplifies roll back • As we shift more traffic over, let auto-scaling grow/shrink our instances - Shut down the old when no traffic there Amazon Route 53 EC2 Instances ELB 100% DynamoDB MySQL RDS Instance ElastiCache Cache Node
  • 12. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved Blue-Green Deployment • Stand up duplicate infrastructure and slowly cut traffic over to it - Shift via DNS - Simplifies feature testing - Simplifies roll back • As we shift more traffic over, let auto-scaling grow/shrink our instances - Shut down the old when no traffic there Amazon Route 53 EC2 Instances ELB EC2 Instances ELB 90% 10% DynamoDB MySQL RDS Instance ElastiCache Cache Node
  • 13. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved Blue-Green Deployment • Stand up duplicate infrastructure and slowly cut traffic over to it - Shift via DNS - Simplifies feature testing - Simplifies roll back • As we shift more traffic over, let auto-scaling grow/shrink our instances - Shut down the old when no traffic there Amazon Route 53 EC2 Instances ELB EC2 Instances ELB 0% 100% DynamoDB MySQL RDS Instance ElastiCache Cache Node
  • 14. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved Blue-Green Deployment • Stand up duplicate infrastructure and slowly cut traffic over to it - Shift via DNS - Simplifies feature testing - Simplifies roll back • As we shift more traffic over, let auto-scaling grow/shrink our instances - Shut down the old when no traffic there Amazon Route 53 EC2 Instances ELB EC2 Instances ELB 0% 100% DynamoDB MySQL RDS Instance ElastiCache Cache Node
  • 15. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved ASG V1 ELB Red-Black Deployment RDS
  • 16. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved ELB ASG V1 ASG V2 UAT RDS Red-Black Deployment
  • 17. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved ELB ASG V1 ASG V2 RDS Red-Black Deployment
  • 18. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved ELB RDS ASG V2 Red-Black Deployment
  • 19. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved Timeline V2.1 ID NAME ADDRESS ORDERID (Char) 23234 Joe Doe xxx 333424 45322 Rob Smith xxxx 234 2342342 Jane Smith xxxx 23424 2342265 Anne Lee xxxx 2342425 Dealing with databases example
  • 20. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved Timeline DB V1.1 V2.1 ID NAME ADDRESS ORDERID ORDERID_INT 23234 Joe Doe xxx 333424 45322 Rob Smith xxxx 234 2342342 Jane Smith xxxx 23424 2342265 Anne Lee xxxx 2342425 Dealing with databases example • Add a New Column
  • 21. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved Deployment Timeline DB V1.1 V2.1 ID NAME ADDRESS ORDERID ORDERID_INT 23234 Joe Doe xxx 333424 45322 Rob Smith xxxx 234 2342342 Jane Smith xxxx 23424 2342265 Anne Lee xxxx 2342425 3632342 Mark Fox cxxxx 567890 567890 Dealing with databases example • Add a New Column • Change Apps to write to both new & old columns
  • 22. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved Deployment Timeline DB V1.1 V2.1 ID NAME ADDRESS ORDERID ORDERID_INT 23234 Joe Doe xxx 333424 333424 45322 Rob Smith xxxx 234 234 2342342 Jane Smith xxxx 23424 23424 2342265 Anne Lee xxxx 2342425 2342425 3632342 Mark Fox cxxxx 567890 567890 DB V1.2 Dealing with databases example • Add a New Column • Change Apps to write to both new & old columns • Migrate old column data to new column ( for older rows)
  • 23. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved Deployment Timeline DB V1.1 V2.1 ID NAME ADDRESS ORDERID ORDERID_INT 23234 Joe Doe xxx 333424 333424 45322 Rob Smith xxxx 234 234 2342342 Jane Smith xxxx 23424 23424 2342265 Anne Lee xxxx 2342425 2342425 3632342 Mark Fox cxxxx 567890 567890 DB V1.2 V2.2 Dealing with databases example • Add a New Column • Change Apps to write to both new & old columns • Migrate old column data to new column ( for older rows) • Update all Apps to read from new column
  • 24. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved Deployment Timeline DB V1.1 V2.1 ID NAME ADDRESS ORDERID ORDERID_INT 23234 Joe Doe xxx 333424 333424 45322 Rob Smith xxxx 234 234 2342342 Jane Smith xxxx 23424 23424 2342265 Anne Lee xxxx 2342425 2342425 3632342 Mark Fox cxxxx 567890 567890 433453 Mark Lee cxxxxx 4352342422 DB V1.2 V2.2 V2.3 Dealing with databases example • Add a New Column • Change Apps to write to both new & old columns • Migrate old column data to new column ( for older rows) • Update all Apps to read from new column • Update all Apps to only write to new column
  • 25. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved Deployment Timeline DB V1.1 V2.1 ID NAME ADDRESS ORDERID_INT 23234 Joe Doe xxx 333424 45322 Rob Smith xxxx 234 2342342 Jane Smith xxxx 23424 2342265 Anne Lee xxxx 2342425 3632342 Mark Fox cxxxx 567890 433453 Mark Lee cxxxxx 4352342422 DB V1.2 V2.2 V2.3 DB V1.3 Dealing with databases example • Add a New Column • Change Apps to write to both new & old columns • Migrate old column data to new column ( for older rows) • Update all Apps to read from new column • Update all Apps to only write to new column • Drop the old column
  • 26. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved MonitorProvisionDeployTestBuildCode Elastic Beanstalk OpsWorks Cloud Watch Cloud Formation Code Deploy Code Commit Code Pipeline AWS DevOps Aligned Services
  • 27. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved EC2CloudFormationOpsWorksBeanstalk Managed Deployment Do it Yourself Convenience Control
  • 28. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved Build CodeBuild AWS CodeBuild NotifyDevelopers Lambda TestAPI Runscope Sequential actions Deploy JavaApp Elastic Beanstalk Source Source GitHub CodePipeline MyApplication
  • 29. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved Build CodeBuild AWS CodeBuild Staging-Deploy JavaApp Elastic Beanstalk Prod-Deploy JavaApp Elastic Beanstalk QATeamReview Manual Approval Manual Approvals Review CodePipeline MyApplication
  • 30. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved Enabling Continuous Delivery • Create repeatable patterns and standardized code elements that allow the enablement of customizable parameterized deployment of entire stacks of applications consistently to our specifications • Build reliable shared services that enable quick adoption of repeatable patterns for many diverse workloads and applications • Provide a consistent set of coded artifacts that can serve to reduce the training, documentation and ramp up costs across a large diverse development team
  • 31. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved Enabling Continuous Delivery • The Continuous Delivery Machine – Enables developers to use shared services and repeatable patterns to create continuous delivery pipelines for their applications and workloads • Continuous Delivery Pipeline – A set of chained automation jobs constructed in phases that orchestrate the build, deploy, test and monitoring of a set of applications or workloads
  • 32. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved Building a Continuous Delivery Machine • Source Code Repository • Continuous Integration System • Infrastructure Provisioning System • Configuration Management System • Artifact Management System • Cetralized Log Management System • Monitoring and Feedback System
  • 33. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved Elements of a Continuous Delivery Pipeline • Commit Phase – Static code analysis • Acceptance Phase – Dynamic analysis • Capacity Phase – Load, performance and failover testing • Exploratory Phase – Penetration and experimental testing • Production Phase – Blue/Green Deployment – Persistent data handling
  • 34. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved Automate Everything • Automation is vital to smaller, more frequent releases • All steps that add human intervention also add fragility - “Small compromises can undermine your success” • Use knowledge gathered from frequent, automated releases to constantly evolve the process
  • 35. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved The Continuous Delivery Maturity Model • Designed to allow for quick enablement of large teams to both create the shared services required to enable Continuous Delivery as well as development of application specific pipelines in concert • Shared services are stood up just in time to allow application teams to mature their pipeline development • The Continuous Delivery System owners are 1 maturity level ahead of the Pipeline owners
  • 36. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved The Continuous Delivery Maturity Model • Builds on Minimal Viable Product concepts to rapidly establish automated deployment capability for many applications • Enables large teams to start contributing quickly • Creates functional systems layer that allows developers to quickly find reusable patterns to apply to new workloads • Allows visibility into how mature workloads are across the organization • Can be measured to compare strategies for success
  • 37. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved References • Blue/Green Deployments on AWS Whitepaper: – Overview, techniques, and best practices for implementing a Blue/Green deployment strategy. – https://d0.awsstatic.com/whitepapers/AWS_Blue_Green_Deployments.pdf • CodeDeploy Tutorials: – http://docs.aws.amazon.com/codedeploy/latest/userguide/tutorials.html • Walkthroughs: – http://docs.aws.amazon.com/codedeploy/latest/userguide/tutorials-github.html • Workflows: – http://docs.aws.amazon.com/codedeploy/latest/userguide/deployment-steps.html
  • 38. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved THANK YOU
  • 39. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved ? https://secure.flickr.com/photos/dullhunk/202872717/