Continuous Delivery on AWS Stephan Hadinger ([email protected]) Rudy Krol ([email protected])
-
Upload
molly-park -
Category
Documents
-
view
217 -
download
2
Transcript of Continuous Delivery on AWS Stephan Hadinger ([email protected]) Rudy Krol ([email protected])
![Page 2: Continuous Delivery on AWS Stephan Hadinger (hadinger@amazon.fr) Rudy Krol (rudykrol@amazon.fr)](https://reader038.fdocuments.us/reader038/viewer/2022110102/56649efd5503460f94c10a56/html5/thumbnails/2.jpg)
v
~11.6sMean time between
deployments (weekday)
~1,079Max number of deployments
in a single hour
~10,000Mean number of hosts
simultaneously receiving a deployment
~30,000Max number of hosts
simultaneously receiving a deployment
Deployments at Amazon.com
![Page 3: Continuous Delivery on AWS Stephan Hadinger (hadinger@amazon.fr) Rudy Krol (rudykrol@amazon.fr)](https://reader038.fdocuments.us/reader038/viewer/2022110102/56649efd5503460f94c10a56/html5/thumbnails/3.jpg)
v
Agenda
Introduction to Continuous Integration (CI) and Continuous Delivery/Deployment (CD)CD strategiesCI-CD on AWS– Application Lifecycle Management– Application Management
Conclusion
![Page 4: Continuous Delivery on AWS Stephan Hadinger (hadinger@amazon.fr) Rudy Krol (rudykrol@amazon.fr)](https://reader038.fdocuments.us/reader038/viewer/2022110102/56649efd5503460f94c10a56/html5/thumbnails/4.jpg)
v
Agenda
Introduction to Continuous Integration (CI) and Continuous Delivery/Deployment (CD)CD strategiesCI-CD on AWS– Application Lifecycle Management– Application Management
Conclusion
![Page 5: Continuous Delivery on AWS Stephan Hadinger (hadinger@amazon.fr) Rudy Krol (rudykrol@amazon.fr)](https://reader038.fdocuments.us/reader038/viewer/2022110102/56649efd5503460f94c10a56/html5/thumbnails/5.jpg)
v
Version Control CI Server
Package Builder
Commit to Git/master
Dev
Get / PullCode
Send Build Report to DevStop everything if build failed
Distributed BuildsRun Tests in parallel
CodeConfigTests
Push
Config
Repo
Continuous Integration
![Page 6: Continuous Delivery on AWS Stephan Hadinger (hadinger@amazon.fr) Rudy Krol (rudykrol@amazon.fr)](https://reader038.fdocuments.us/reader038/viewer/2022110102/56649efd5503460f94c10a56/html5/thumbnails/6.jpg)
v
• Test driven promotion (of development change)• Increasing velocity of feedback cycle through iterative change• Bugs are detected quickly• Automated testing reduces size of testing effort
What does CI give us?
![Page 7: Continuous Delivery on AWS Stephan Hadinger (hadinger@amazon.fr) Rudy Krol (rudykrol@amazon.fr)](https://reader038.fdocuments.us/reader038/viewer/2022110102/56649efd5503460f94c10a56/html5/thumbnails/7.jpg)
v
Continuous Delivery/Deployment
Version Control CI Server
Package Builder
Deploy ServerCommit to
Git/masterDev
Get / PullCode
AMIs
Send Build Report to DevStop everything if build failed
Distributed BuildsRun Tests in parallel
Staging Env
Test Env
CodeConfigTests
Prod Env
Push
Config InstallCreate
Repo
CloudFormation Templates for Env
Generate
![Page 8: Continuous Delivery on AWS Stephan Hadinger (hadinger@amazon.fr) Rudy Krol (rudykrol@amazon.fr)](https://reader038.fdocuments.us/reader038/viewer/2022110102/56649efd5503460f94c10a56/html5/thumbnails/8.jpg)
v
• Automated, repeatable process to push changes to production• Hardens, de-risks the deployment process• Immediate feedback from users• 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?
![Page 9: Continuous Delivery on AWS Stephan Hadinger (hadinger@amazon.fr) Rudy Krol (rudykrol@amazon.fr)](https://reader038.fdocuments.us/reader038/viewer/2022110102/56649efd5503460f94c10a56/html5/thumbnails/9.jpg)
v
Continuous Delivery versus Continuous Deployment
![Page 10: Continuous Delivery on AWS Stephan Hadinger (hadinger@amazon.fr) Rudy Krol (rudykrol@amazon.fr)](https://reader038.fdocuments.us/reader038/viewer/2022110102/56649efd5503460f94c10a56/html5/thumbnails/10.jpg)
v
Example CI/CD pipeline
Dev
IT Ops
Version Control
Build/Compile
Code
Unit TestApp Code
DR Env
Test Env
Prod Env
Dev Env
Application
WriteApp Code
Infrastructure
CloudFormation
tar, war, zipyum, rpmDeploy
AppPackage
Application
Deploy application only
Deploy infrastructure only
BuildAMIs
ValidateTemplates
WriteInfra Code
DeployInfras
AutomateDeployment
Artifact Repository
AMIs
![Page 11: Continuous Delivery on AWS Stephan Hadinger (hadinger@amazon.fr) Rudy Krol (rudykrol@amazon.fr)](https://reader038.fdocuments.us/reader038/viewer/2022110102/56649efd5503460f94c10a56/html5/thumbnails/11.jpg)
vHOST METRICS
SERVICEMETRICS
LOG ANALYSIS EXTERNAL SITE METRICS
![Page 12: Continuous Delivery on AWS Stephan Hadinger (hadinger@amazon.fr) Rudy Krol (rudykrol@amazon.fr)](https://reader038.fdocuments.us/reader038/viewer/2022110102/56649efd5503460f94c10a56/html5/thumbnails/12.jpg)
v
Agenda
Introduction to Continuous Integration (CI) and Continuous Delivery/Deployment (CD)CD strategiesCI-CD on AWS– Application Lifecycle Management– Application Management
Conclusion
![Page 13: Continuous Delivery on AWS Stephan Hadinger (hadinger@amazon.fr) Rudy Krol (rudykrol@amazon.fr)](https://reader038.fdocuments.us/reader038/viewer/2022110102/56649efd5503460f94c10a56/html5/thumbnails/13.jpg)
v
• How fast do we need to do this?• Across how many instances?• How do we roll back (or forward)?
Delivery approaches
![Page 14: Continuous Delivery on AWS Stephan Hadinger (hadinger@amazon.fr) Rudy Krol (rudykrol@amazon.fr)](https://reader038.fdocuments.us/reader038/viewer/2022110102/56649efd5503460f94c10a56/html5/thumbnails/14.jpg)
v
AMI building/deployment methods
![Page 15: Continuous Delivery on AWS Stephan Hadinger (hadinger@amazon.fr) Rudy Krol (rudykrol@amazon.fr)](https://reader038.fdocuments.us/reader038/viewer/2022110102/56649efd5503460f94c10a56/html5/thumbnails/15.jpg)
vFully Functional AMI OS-Only AMI
Partially Configured AMI
Most amount of post-boot work
Least flexibleto maintain
Try and find a happy medium here
Delivery approaches
![Page 16: Continuous Delivery on AWS Stephan Hadinger (hadinger@amazon.fr) Rudy Krol (rudykrol@amazon.fr)](https://reader038.fdocuments.us/reader038/viewer/2022110102/56649efd5503460f94c10a56/html5/thumbnails/16.jpg)
vDeploy in place • Deploy all at once (service outage)• Rolling updates
Red-Black deployment• Discrete environment• Multiple environments from branches• Support A/B testing• Use auto scaling group
Deployment approaches
![Page 17: Continuous Delivery on AWS Stephan Hadinger (hadinger@amazon.fr) Rudy Krol (rudykrol@amazon.fr)](https://reader038.fdocuments.us/reader038/viewer/2022110102/56649efd5503460f94c10a56/html5/thumbnails/17.jpg)
v
Deploy in place – Rolling update
OpsWorks CodeDeploy
![Page 18: Continuous Delivery on AWS Stephan Hadinger (hadinger@amazon.fr) Rudy Krol (rudykrol@amazon.fr)](https://reader038.fdocuments.us/reader038/viewer/2022110102/56649efd5503460f94c10a56/html5/thumbnails/18.jpg)
v
Deploy in place – Rolling update
![Page 19: Continuous Delivery on AWS Stephan Hadinger (hadinger@amazon.fr) Rudy Krol (rudykrol@amazon.fr)](https://reader038.fdocuments.us/reader038/viewer/2022110102/56649efd5503460f94c10a56/html5/thumbnails/19.jpg)
v
Deploy in place – Rolling update
![Page 20: Continuous Delivery on AWS Stephan Hadinger (hadinger@amazon.fr) Rudy Krol (rudykrol@amazon.fr)](https://reader038.fdocuments.us/reader038/viewer/2022110102/56649efd5503460f94c10a56/html5/thumbnails/20.jpg)
v
Deploy in place – Rolling update
![Page 21: Continuous Delivery on AWS Stephan Hadinger (hadinger@amazon.fr) Rudy Krol (rudykrol@amazon.fr)](https://reader038.fdocuments.us/reader038/viewer/2022110102/56649efd5503460f94c10a56/html5/thumbnails/21.jpg)
v
Deploy in place – Rolling update
![Page 22: Continuous Delivery on AWS Stephan Hadinger (hadinger@amazon.fr) Rudy Krol (rudykrol@amazon.fr)](https://reader038.fdocuments.us/reader038/viewer/2022110102/56649efd5503460f94c10a56/html5/thumbnails/22.jpg)
v
Deploy in place – Rolling update
![Page 23: Continuous Delivery on AWS Stephan Hadinger (hadinger@amazon.fr) Rudy Krol (rudykrol@amazon.fr)](https://reader038.fdocuments.us/reader038/viewer/2022110102/56649efd5503460f94c10a56/html5/thumbnails/23.jpg)
v
Deploy in place – Rolling update
![Page 24: Continuous Delivery on AWS Stephan Hadinger (hadinger@amazon.fr) Rudy Krol (rudykrol@amazon.fr)](https://reader038.fdocuments.us/reader038/viewer/2022110102/56649efd5503460f94c10a56/html5/thumbnails/24.jpg)
v
Deploy in place – Rolling update
![Page 25: Continuous Delivery on AWS Stephan Hadinger (hadinger@amazon.fr) Rudy Krol (rudykrol@amazon.fr)](https://reader038.fdocuments.us/reader038/viewer/2022110102/56649efd5503460f94c10a56/html5/thumbnails/25.jpg)
v
Red-Black deployment
EC2 Instances
ELB
DynamoDB MySQL RDSInstance
ElastiCache Cache Node
Auto Scaling Group
V1
![Page 26: Continuous Delivery on AWS Stephan Hadinger (hadinger@amazon.fr) Rudy Krol (rudykrol@amazon.fr)](https://reader038.fdocuments.us/reader038/viewer/2022110102/56649efd5503460f94c10a56/html5/thumbnails/26.jpg)
v
Red-Black deployment
EC2 Instances
ELB
DynamoDB MySQL RDSInstance
ElastiCache Cache Node
Auto Scaling Group
V1 EC2 Instances
UAT
Auto Scaling Group
V2
![Page 27: Continuous Delivery on AWS Stephan Hadinger (hadinger@amazon.fr) Rudy Krol (rudykrol@amazon.fr)](https://reader038.fdocuments.us/reader038/viewer/2022110102/56649efd5503460f94c10a56/html5/thumbnails/27.jpg)
v
Red-Black deployment
EC2 Instances
ELB
DynamoDB MySQL RDSInstance
ElastiCache Cache Node
Auto Scaling Group
V1 EC2 Instances
Auto Scaling Group
V2
![Page 28: Continuous Delivery on AWS Stephan Hadinger (hadinger@amazon.fr) Rudy Krol (rudykrol@amazon.fr)](https://reader038.fdocuments.us/reader038/viewer/2022110102/56649efd5503460f94c10a56/html5/thumbnails/28.jpg)
v
Red-Black deployment
ELB
DynamoDB MySQL RDSInstance
ElastiCache Cache Node
EC2 Instances
Auto Scaling Group
V2EC2 Instances
Auto Scaling Group
V1
![Page 29: Continuous Delivery on AWS Stephan Hadinger (hadinger@amazon.fr) Rudy Krol (rudykrol@amazon.fr)](https://reader038.fdocuments.us/reader038/viewer/2022110102/56649efd5503460f94c10a56/html5/thumbnails/29.jpg)
v
Red-Black deployment
ELB
DynamoDB MySQL RDSInstance
ElastiCache Cache Node
EC2 Instances
Auto Scaling Group
V2EC2 Instances
Auto Scaling Group
V1
![Page 30: Continuous Delivery on AWS Stephan Hadinger (hadinger@amazon.fr) Rudy Krol (rudykrol@amazon.fr)](https://reader038.fdocuments.us/reader038/viewer/2022110102/56649efd5503460f94c10a56/html5/thumbnails/30.jpg)
v
Agenda
Introduction to Continuous Integration (CI) and Continuous Delivery/Deployment (CD)CD strategiesCI-CD on AWS– Application Lifecycle Management
• CodeCommit• CodePipeline• CodeDeploy
– Application Management
Conclusion
Version Control
Build/Compile
CodeDev
Unit TestApp Code
IT Ops
DR Env
Test Env
Prod Env
Dev Env
Application
WriteApp Code
Infrastructure
DeployApp.
PackageApp.
BuildAMIs
ValidateTemplates
WriteInfra Code
DeployInfras
AutomateDeploy
Artifact Repository
![Page 31: Continuous Delivery on AWS Stephan Hadinger (hadinger@amazon.fr) Rudy Krol (rudykrol@amazon.fr)](https://reader038.fdocuments.us/reader038/viewer/2022110102/56649efd5503460f94c10a56/html5/thumbnails/31.jpg)
vA secure, highly scalable, managed source control service that hosts private Git repositories
Eliminates the need to operate your own source control system or worry about scaling its infrastructure
Built-in encryption support
Fully integrated with AWS Identity and Access Management (IAM)
Basically, managed Git
AnnouncedAWS CodeCommit
![Page 32: Continuous Delivery on AWS Stephan Hadinger (hadinger@amazon.fr) Rudy Krol (rudykrol@amazon.fr)](https://reader038.fdocuments.us/reader038/viewer/2022110102/56649efd5503460f94c10a56/html5/thumbnails/32.jpg)
v
Agenda
Introduction to Continuous Integration (CI) and Continuous Delivery/Deployment (CD)CD strategiesCI-CD on AWS– Application Lifecycle Management
• CodeCommit• CodePipeline• CodeDeploy
– Application Management
Conclusion
Version Control
Build/Compile
CodeDev
Unit TestApp Code
IT Ops
DR Env
Test Env
Prod Env
Dev Env
Application
WriteApp Code
Infrastructure
DeployApp.
PackageApp.
BuildAMIs
ValidateTemplates
WriteInfra Code
DeployInfras
AutomateDeploy
Artifact Repository
![Page 33: Continuous Delivery on AWS Stephan Hadinger (hadinger@amazon.fr) Rudy Krol (rudykrol@amazon.fr)](https://reader038.fdocuments.us/reader038/viewer/2022110102/56649efd5503460f94c10a56/html5/thumbnails/33.jpg)
vA continuous delivery and release automation service that aids smooth deployments
You can design your development workflow for checking in code, building the code, deploying your application into staging, testing it, and releasing it to production
Able to be used stand-alone as an end-to-end solution, or can be integrated with your existing source control system, test framework or build tools (like Bamboo, Jenkins, etc) Similar to Bamboo or Jenkins
AnnouncedAWS CodePipeline
![Page 34: Continuous Delivery on AWS Stephan Hadinger (hadinger@amazon.fr) Rudy Krol (rudykrol@amazon.fr)](https://reader038.fdocuments.us/reader038/viewer/2022110102/56649efd5503460f94c10a56/html5/thumbnails/34.jpg)
v
Agenda
Introduction to Continuous Integration (CI) and Continuous Delivery/Deployment (CD)CD strategiesCI-CD on AWS– Application Lifecycle Management
• CodeCommit• CodePipeline• CodeDeploy
– Application Management
Conclusion
Version Control
Build/Compile
CodeDev
Unit TestApp Code
IT Ops
DR Env
Test Env
Prod Env
Dev Env
Application
WriteApp Code
Infrastructure
DeployApp.
PackageApp.
BuildAMIs
ValidateTemplates
WriteInfra Code
DeployInfras
AutomateDeploy
Artifact Repository
![Page 35: Continuous Delivery on AWS Stephan Hadinger (hadinger@amazon.fr) Rudy Krol (rudykrol@amazon.fr)](https://reader038.fdocuments.us/reader038/viewer/2022110102/56649efd5503460f94c10a56/html5/thumbnails/35.jpg)
v
Limited regions
CodeDeploy workflow
CodeCommit
![Page 36: Continuous Delivery on AWS Stephan Hadinger (hadinger@amazon.fr) Rudy Krol (rudykrol@amazon.fr)](https://reader038.fdocuments.us/reader038/viewer/2022110102/56649efd5503460f94c10a56/html5/thumbnails/36.jpg)
v
Agenda
Introduction to Continuous Integration (CI) and Continuous Delivery/Deployment (CD)CD strategiesCI-CD on AWS– Application Lifecycle Management– Application Management
• Elastic Beanstalk• Opsworks• CloudFormation• EC2 Container Service (ECS)
Conclusion
![Page 37: Continuous Delivery on AWS Stephan Hadinger (hadinger@amazon.fr) Rudy Krol (rudykrol@amazon.fr)](https://reader038.fdocuments.us/reader038/viewer/2022110102/56649efd5503460f94c10a56/html5/thumbnails/37.jpg)
vAWS Elastic Beanstalk
Automated resource management – web
apps made easy
AWS OpsWorks
DevOps framework for application lifecycle management and
automation
DIY / On Demand
DIY, on demand resources: EC2, S3, custom AMI’s, etc.
Convenience Control
Deployment and Management
AWS CloudFormation
Templates to deploy & update infrastructure as
code
![Page 38: Continuous Delivery on AWS Stephan Hadinger (hadinger@amazon.fr) Rudy Krol (rudykrol@amazon.fr)](https://reader038.fdocuments.us/reader038/viewer/2022110102/56649efd5503460f94c10a56/html5/thumbnails/38.jpg)
v
Agenda
Introduction to Continuous Integration (CI) and Continuous Delivery/Deployment (CD)CD strategiesCI-CD on AWS– Application Lifecycle Management– Application Management
• Elastic Beanstalk• OpsWorks• CloudFormation• EC2 Container Service (ECS)
Conclusion
Version Control
Build/Compile
CodeDev
Unit TestApp Code
IT Ops
DR Env
Test Env
Prod Env
Dev Env
Application
WriteApp Code
Infrastructure
DeployApp.
PackageApp.
BuildAMIs
ValidateTemplates
WriteInfra Code
DeployInfras
AutomateDeploy
Artifact Repository
![Page 39: Continuous Delivery on AWS Stephan Hadinger (hadinger@amazon.fr) Rudy Krol (rudykrol@amazon.fr)](https://reader038.fdocuments.us/reader038/viewer/2022110102/56649efd5503460f94c10a56/html5/thumbnails/39.jpg)
v• Easily deploy, monitor, and scale three-tier web applications and services.
• Infrastructure provisioned and managed by EB – but you maintain complete control.
• Preconfigured application containers that are easily customizable.
• Support for these platforms:
Java PHP Python Ruby .NET Node.js Docker Go
AWS Elastic Beanstalk (EB)
![Page 40: Continuous Delivery on AWS Stephan Hadinger (hadinger@amazon.fr) Rudy Krol (rudykrol@amazon.fr)](https://reader038.fdocuments.us/reader038/viewer/2022110102/56649efd5503460f94c10a56/html5/thumbnails/40.jpg)
vApplication
Environments• Infrastructure resources (such
as EC2 instances, ELB load balancers, and Auto Scaling groups)
• Runs a single application version at a time for better scalability
• An application can have many environments (such as staging and production)
Application versions• Application code• Stored in Amazon S3• An application can have many
application versions (easy to rollback to previous versions)
Saved configurations• Configuration that defines how
an environment and its resources behave
• Can be used to launch new environments quickly or roll-back configuration
• An application can have many saved configurations
Elastic Beanstalk model
![Page 41: Continuous Delivery on AWS Stephan Hadinger (hadinger@amazon.fr) Rudy Krol (rudykrol@amazon.fr)](https://reader038.fdocuments.us/reader038/viewer/2022110102/56649efd5503460f94c10a56/html5/thumbnails/41.jpg)
v• Two types:• Single instance
• Load balancing, auto scaling
• Two tiers (web server and worker)• Elastic Beanstalk provisions necessary
infrastructure resources such as load balancers, auto-scaling groups, security groups, and databases (optional)
• Configures Amazon Route 53 and gives you a unique domain name
(For example: yourapp.elasticbeanstalk.com)
Elastic Beanstalk environment
![Page 42: Continuous Delivery on AWS Stephan Hadinger (hadinger@amazon.fr) Rudy Krol (rudykrol@amazon.fr)](https://reader038.fdocuments.us/reader038/viewer/2022110102/56649efd5503460f94c10a56/html5/thumbnails/42.jpg)
vYour code
HTTP server
Application server
Language interpreter
Operating system
Host
• Elastic Beanstalk configures each EC2 instance in your environment with the components necessary to run applications for the selected platform
• No more worrying about logging into instances to install and configure your application stack
Focus on building your application
On-Instance configuration
![Page 43: Continuous Delivery on AWS Stephan Hadinger (hadinger@amazon.fr) Rudy Krol (rudykrol@amazon.fr)](https://reader038.fdocuments.us/reader038/viewer/2022110102/56649efd5503460f94c10a56/html5/thumbnails/43.jpg)
v
Saved configurationsSave these for easy duplication for A/B testing or non-disruptive deployments
Application versionsAll versions are stored durably in Amazon S3. Code can also be pushed from a Git repository
Application versions and saved configurations
![Page 44: Continuous Delivery on AWS Stephan Hadinger (hadinger@amazon.fr) Rudy Krol (rudykrol@amazon.fr)](https://reader038.fdocuments.us/reader038/viewer/2022110102/56649efd5503460f94c10a56/html5/thumbnails/44.jpg)
vVia the AWS Management Console Via EB CLI
Via the AWS Toolkit for Eclipse and the Visual Studio IDE
$ eb deploy
Deployment options
1
2
3
![Page 45: Continuous Delivery on AWS Stephan Hadinger (hadinger@amazon.fr) Rudy Krol (rudykrol@amazon.fr)](https://reader038.fdocuments.us/reader038/viewer/2022110102/56649efd5503460f94c10a56/html5/thumbnails/45.jpg)
v
Agenda
Introduction to Continuous Integration (CI) and Continuous Delivery/Deployment (CD)CD strategiesCI-CD on AWS– Application Lifecycle Management– Application Management
• Elastic Beanstalk• OpsWorks• CloudFormation• EC2 Container Service (ECS)
Conclusion
Version Control
Build/Compile
CodeDev
Unit TestApp Code
IT Ops
DR Env
Test Env
Prod Env
Dev Env
Application
WriteApp Code
Infrastructure
DeployConf + App.
PackageApp.
BuildAMIs
ValidateTemplates
WriteInfra Code
DeployInfras
AutomateDeploy
Artifact Repository
![Page 46: Continuous Delivery on AWS Stephan Hadinger (hadinger@amazon.fr) Rudy Krol (rudykrol@amazon.fr)](https://reader038.fdocuments.us/reader038/viewer/2022110102/56649efd5503460f94c10a56/html5/thumbnails/46.jpg)
v
On-instance execution viaChef client/zero
CommandJSON
CommandLog+StatusOpsWorks
AWS OpsWorks architecture
1
23
![Page 47: Continuous Delivery on AWS Stephan Hadinger (hadinger@amazon.fr) Rudy Krol (rudykrol@amazon.fr)](https://reader038.fdocuments.us/reader038/viewer/2022110102/56649efd5503460f94c10a56/html5/thumbnails/47.jpg)
v
• Supports Chef 11.10• Built-in convenience cookbooks / bring your own• Chef run is triggered by lifecycle event firing: push vs. pull• Event comes with stack state JSON
Chef integration
![Page 48: Continuous Delivery on AWS Stephan Hadinger (hadinger@amazon.fr) Rudy Krol (rudykrol@amazon.fr)](https://reader038.fdocuments.us/reader038/viewer/2022110102/56649efd5503460f94c10a56/html5/thumbnails/48.jpg)
v
A stack represents the cloud infrastructure and applications that you want to manage together
A layer defines how to setup and configure a set of instances and related resources. Eg Java App server layer, PHP layer, RDS layer, MySQL Layer, HAProxy layer etc
An instance represents an Amazon EC2 instance and defines how to scale: manually, 24/7 instances, or automatically, with load-based or time-based instances
Each applicationis represented by an app, which specifies the application type and contains the information that AWSOpsWorks needs to deploy the application from the repository to your instances
OpsWorks components
stack layer instance app
![Page 49: Continuous Delivery on AWS Stephan Hadinger (hadinger@amazon.fr) Rudy Krol (rudykrol@amazon.fr)](https://reader038.fdocuments.us/reader038/viewer/2022110102/56649efd5503460f94c10a56/html5/thumbnails/49.jpg)
v
Instance lifecycle commands
![Page 50: Continuous Delivery on AWS Stephan Hadinger (hadinger@amazon.fr) Rudy Krol (rudykrol@amazon.fr)](https://reader038.fdocuments.us/reader038/viewer/2022110102/56649efd5503460f94c10a56/html5/thumbnails/50.jpg)
v
Agenda
Introduction to Continuous Integration (CI) and Continuous Delivery/Deployment (CD)CD strategiesCI-CD on AWS– Application Lifecycle Management– Application Management
• Elastic Beanstalk• OpsWorks• CloudFormation• EC2 Container Service (ECS)
Conclusion
Version Control
Build/Compile
CodeDev
Unit TestApp Code
IT Ops
DR Env
Test Env
Prod Env
Dev Env
Application
WriteApp Code
Infrastructure
DeployApp.
PackageApp.
BuildAMIs
ValidateTemplates
WriteInfra Code
DeployInfras
AutomateDeploy
Artifact Repository
![Page 51: Continuous Delivery on AWS Stephan Hadinger (hadinger@amazon.fr) Rudy Krol (rudykrol@amazon.fr)](https://reader038.fdocuments.us/reader038/viewer/2022110102/56649efd5503460f94c10a56/html5/thumbnails/51.jpg)
v• Infrastructure as Code
• Integrates with version control
• JSON format
• Templates
• Stacks
• Supports all AWS resource types
AWS CloudFormation
![Page 52: Continuous Delivery on AWS Stephan Hadinger (hadinger@amazon.fr) Rudy Krol (rudykrol@amazon.fr)](https://reader038.fdocuments.us/reader038/viewer/2022110102/56649efd5503460f94c10a56/html5/thumbnails/52.jpg)
v
Architecting on AWS – Overview of Services for Web Applications
Template File Defining Stack
GitSubversion
Mercurial
The entire infrastructure can be represented in an AWS CloudFormation template.
Use the version control system of your choice to store and track changes to this template Build out multiple
environments, such as for Development, Test, and Production using the template
Application stack example
Test
Dev
Prod
![Page 53: Continuous Delivery on AWS Stephan Hadinger (hadinger@amazon.fr) Rudy Krol (rudykrol@amazon.fr)](https://reader038.fdocuments.us/reader038/viewer/2022110102/56649efd5503460f94c10a56/html5/thumbnails/53.jpg)
v{ "Description" : "Create an EC2 instance.”, "Resources" : { "Ec2Instance" : { "Type" : "AWS::EC2::Instance", "Properties" : { "KeyName" : “my-key-pair”, "ImageId" : "ami-75g0061f”, “InstanceType” : “m1.medium” } } }}
Template anatomy
![Page 54: Continuous Delivery on AWS Stephan Hadinger (hadinger@amazon.fr) Rudy Krol (rudykrol@amazon.fr)](https://reader038.fdocuments.us/reader038/viewer/2022110102/56649efd5503460f94c10a56/html5/thumbnails/54.jpg)
v{ "Description" : "Create an EC2 instance.”, "Parameters" : { "UserKeyName" : { "Description" : "The EC2 Key Pair to allow SSH access to the instance", "Type" : "String" } }, "Resources" : { "Ec2Instance" : { "Type" : "AWS::EC2::Instance", "Properties" : { "KeyName" : { “Ref” : “UserKeyName”}, "ImageId" : "ami-75g0061f”, “InstanceType” : “m1.medium” } } }}
Template anatomy
![Page 55: Continuous Delivery on AWS Stephan Hadinger (hadinger@amazon.fr) Rudy Krol (rudykrol@amazon.fr)](https://reader038.fdocuments.us/reader038/viewer/2022110102/56649efd5503460f94c10a56/html5/thumbnails/55.jpg)
v
Agenda
Introduction to Continuous Integration (CI) and Continuous Delivery/Deployment (CD)CD strategiesCI-CD on AWS– Application Lifecycle Management– Application Management
• Elastic Beanstalk• OpsWorks• CloudFormation• EC2 Container Service (ECS)
Conclusion
Version Control
Build/Compile
CodeDev
Unit TestApp Code
IT Ops
DR Env
Test Env
Prod Env
Dev Env
Application
WriteApp Code
Infrastructure
DeployContainers
PackageContainers
BuildAMIs
ValidateTemplates
WriteInfra Code
DeployInfras
AutomateDeploy
Artifact Repository
![Page 56: Continuous Delivery on AWS Stephan Hadinger (hadinger@amazon.fr) Rudy Krol (rudykrol@amazon.fr)](https://reader038.fdocuments.us/reader038/viewer/2022110102/56649efd5503460f94c10a56/html5/thumbnails/56.jpg)
v• Cluster management made easy• Flexible scheduling• High performance• Resource efficiency• Extensible• Security• Programmatic control• Docker compatibility• Monitoring• AWS integration
EC2 Container Service (ECS)
![Page 57: Continuous Delivery on AWS Stephan Hadinger (hadinger@amazon.fr) Rudy Krol (rudykrol@amazon.fr)](https://reader038.fdocuments.us/reader038/viewer/2022110102/56649efd5503460f94c10a56/html5/thumbnails/57.jpg)
vI have a docker image I want to run in a cluster
Push images
Create task definition
Run instances Use custom AMI with docker support and ECS agent. ECS agent will register with default cluster
Describe cluster Get information about cluster and available resources
Similar to fig template
Customer
Customer
Customer
Customer
Customer
User workflow
1
2
3
4
5
![Page 58: Continuous Delivery on AWS Stephan Hadinger (hadinger@amazon.fr) Rudy Krol (rudykrol@amazon.fr)](https://reader038.fdocuments.us/reader038/viewer/2022110102/56649efd5503460f94c10a56/html5/thumbnails/58.jpg)
v
Run task
Describe cluster
Customer
Customer
User workflow
6
7
Initial cluster state
Run task
8 New cluster state
![Page 59: Continuous Delivery on AWS Stephan Hadinger (hadinger@amazon.fr) Rudy Krol (rudykrol@amazon.fr)](https://reader038.fdocuments.us/reader038/viewer/2022110102/56649efd5503460f94c10a56/html5/thumbnails/59.jpg)
v
Agenda
Introduction to Continuous Integration (CI) and Continuous Delivery/Deployment (CD)CD strategiesCI-CD on AWS– Application Lifecycle Management– Application Management
Conclusion
![Page 60: Continuous Delivery on AWS Stephan Hadinger (hadinger@amazon.fr) Rudy Krol (rudykrol@amazon.fr)](https://reader038.fdocuments.us/reader038/viewer/2022110102/56649efd5503460f94c10a56/html5/thumbnails/60.jpg)
v“Build your datacenter in 5 minutes.”
Infrastructure as Code
![Page 61: Continuous Delivery on AWS Stephan Hadinger (hadinger@amazon.fr) Rudy Krol (rudykrol@amazon.fr)](https://reader038.fdocuments.us/reader038/viewer/2022110102/56649efd5503460f94c10a56/html5/thumbnails/61.jpg)
v“Treat your instances as cattle!” Feel free to create
and terminate instances
![Page 62: Continuous Delivery on AWS Stephan Hadinger (hadinger@amazon.fr) Rudy Krol (rudykrol@amazon.fr)](https://reader038.fdocuments.us/reader038/viewer/2022110102/56649efd5503460f94c10a56/html5/thumbnails/62.jpg)
v
“If it moves, plot it.”
Measure everything
![Page 63: Continuous Delivery on AWS Stephan Hadinger (hadinger@amazon.fr) Rudy Krol (rudykrol@amazon.fr)](https://reader038.fdocuments.us/reader038/viewer/2022110102/56649efd5503460f94c10a56/html5/thumbnails/63.jpg)
v“If it hurts, do it more often.”Automate
everything(for security, efficiency and
business agility)
![Page 64: Continuous Delivery on AWS Stephan Hadinger (hadinger@amazon.fr) Rudy Krol (rudykrol@amazon.fr)](https://reader038.fdocuments.us/reader038/viewer/2022110102/56649efd5503460f94c10a56/html5/thumbnails/64.jpg)
v
Questions?