aws january 2016 webinar series - introduction to deploying applications on aws
TRANSCRIPT
© 2015, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Warren Santner, Solutions Architect
January 26, 2016
EssentialsIntroduction to Deploying Applications on AWS
Learning Objectives
• Understand the primary services for deploying your application on AWS
• Learn the basics of AWS Elastic Beanstalk, AWS CodeDeploy, and Amazon EC2 Container Service
• Gain an understanding of the strengths of each service and when to use them
Deployments are Not Easy
• Traditional environments favor in-place upgrades
• Resource constraints• Downtime• Dependencies• Fragile, High-Touch
Processes• Difficult rollback
Common Deployment Risks
ChallengesApplication failureInfrastructure failureCapacity issuesScaling issuesPeople failureProcess failureRollback issues
Business ImpactsDowntimeData lossBad customer experienceLost revenueGrumpy managersBurned out staffWasted time/resources
Benefits of Deploying with AWS Services
AWS:• Agile deployments• Flexible options• Scalable capacity• Automation capabilities
Elastic Beanstalk CodeDeploy EC2 ContainerService (ECS)
Deploy Web Applications without
Managing Infrastructure
Automate Code Deployments to EC2
and On-Premises
Easily Deploy on Managed Docker
Clusters
Three Choices for Deployment
Common Patterns
You want to simply deploy your web
application (code or container) without
managing the infrastructure.
You need a scalable cluster to run simple
and complex container
deployments.
You require a flexible tool to deploy and
update software on the instances you manage both on-
premises and in the cloud.
Elastic Beanstalk CodeDeploy EC2 ContainerService (ECS)
“I’ve been developing a Django application on my laptop and am ready to go into production.”
“We need a way to deploy and scale microservices across a cluster of instances.”
“We outsourced the development of a new web application that our contractor delivered as a WAR that we need to run and scale in production.”
“Our operations team manages a fleet of application servers, but we need more flexibility to do rolling updates.”
“We have a deployment that requires executing custom tasks before and after the installation while orchestrating the deployment without downtime.”
“Our dev teams are moving to Docker containers and we need to build a platform to support running them at scale in production.”
Use CasesElastic Beanstalk
CodeDeploy
EC2 Container Service
AWS Elastic Beanstalkdeploy and scale web applications and services developed with Java, .NET, PHP, Node.js, Python, Ruby, Go, and Docker
Benefits
Fast & simple to begin
Developer productivity
Impossible to outgrow
Complete resource control
AWS Elastic Beanstalk Overview
Your code
HTTP server
Application server
Language interpreter
Operating system
Instance
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
Provided by you
Provided and managed by Elastic Beanstalk
On-instance configuration
Platform Support
PHP
Python
Java
Ruby
Node.js
.NET
Go
Docker
Environments ConfigurationsSave these for easy duplication for A/B testing or non-disruptive deployments
Application VersionsAll versions stored durably in Amazon S3. Application can also be pushed from a Git repository!
App Versions & Environments
Deploy Your App for Test and ProductionS
ingl
e In
stan
ce
App
AZ
http://your-dev-app.elasticbeanstalk.com
Load
Bal
ance
d, A
uto
Sca
led
App
AZ
ELB
http://your-prod-app.elasticbeanstalk.com
AWS CodeDeployautomate code deployments to any instance, including Amazon EC2 instances and instances running on-premises
Benefits
Automates Deployments
Minimize Downtime Centralized Control East to Adopt
Scale from one instance to thousandsDeploy to any server: AWS or on-premisesCentrally control and monitor
Test
CodeDeployv1, v2, v3
Production
Dev
applicationrevisions
deployment groups
Agent
Agent Agent
Agent
Agent
Agent
Agent
Coordinate Automated Deployments
How It Works: Package App
version: 0.0os: linuxfiles: - source: chef/ destination: /etc/chef/codedeploy - source: target/hello.war destination: /var/lib/tomcat6/webappshooks: ApplicationStop: - location: deploy_hooks/stop-tomcat.sh BeforeInstall: - location: deploy_hooks/install-chef.sh - location: deploy_hooks/chef-solo.sh ApplicationStart: - location: deploy_hooks/start-tomcat.sh ValidateService: - location: deploy_hooks/verify_service.sh
Agent Agent Agent
Test
Agent Agent
Agent Agent
Agent
Agent
Production
Deployment groupDeployment group
Group instances by:• Auto Scaling Group• Amazon EC2 Tag• On-Premises Tag
How It Works: Specify Targets
aws deploy create-deployment \--application-name MyApp \--deployment-group-name TargetGroup \--s3-location bucket=MyBucket,key=MyApp.zip
• AWS CLI & SDKs• AWS Console• AWS CodePipeline & CI/CD Partners• S3, GitHub & BitBucket
How It Works: Deploy
v2 v1 v1 v1 v1 v1 v1 v1
v2 v2 v1 v1 v1 v1 v1 v1
v2 v2 v2 v2 v1 v1 v1 v1
v2 v2 v2 v2 v2 v2 v2 v2
One-at-a-timeMin. healthy hosts = 99%
[Custom]Min. healthy hosts = 75%
Half-at-a-timeMin. healthy hosts = 50%
All-at-onceMin. healthy hosts = 0
Deployment Configurations
Amazon EC2 Container Servicehighly scalable, high performance container management service that supports Docker containers and allows you to easily run applications on a managed cluster of Amazon EC2 instances
Amazon EC2 Container Service
• Highly scalable, high performance container management service that supports Docker.
• Takes care of reliable state management and flexible scheduling for you.
Application fidelity from the developer desk to production.
Package your application and dependencies into a Docker container.
EC2 Container Service Benefits
Cluster Management Made Easy
Performance at Scale
Integrated
ECS Components
Task Definition
ECS Cluster
Container Instance
ECS Service Scheduler – Updating Your App
Deployment process:• Start with blue task definition
referenced by an ECS service • Create a green revision of the
existing task definition• Update existing ECS service to use
the updated task definition• ECS will deploy the new task
definition to container instances in a rolling fashion
Pattern: ECS service update
Deployment process:• Start with blue task definition
referenced by an ECS service • Create a green revision of the
existing task definition• Update existing ECS service to use
the updated task definition• ECS will deploy the new task
definition to container instances in a rolling fashion
Pattern: ECS service update
Deployment process:• Start with blue task definition
referenced by an ECS service • Create a green revision of the
existing task definition• Update existing ECS service to use
the updated task definition• ECS will deploy the new task
definition to container instances in a rolling fashion
Pattern: ECS service update
Deployment process:• Start with blue task definition
referenced by an ECS service • Create a green revision of the
existing task definition• Update existing ECS service to use
the updated task definition• ECS will deploy the new task
definition to container instances in a rolling fashion
Service Comparison
Decision Tree
Are you using Docker or VMs?
Docker VMs
Do you have a 3-Tier web app or website?
NoYes
Use CodeDeploy
Use ECSUse Elastic Beanstalk
Use Elastic Beanstalk
Do you have a 3-Tier web app or website?
Yes No
Elastic Beanstalk CodeDeploy EC2 Container Service
OverviewSimply deploy your application on a set number of platforms
Deploy any application on your infrastructure and integrate with existing CI/CD processes
Use a managed cluster and focus on development and deployment of Linux Docker Containers
DeploymentTargets
Tomcat, PHP, Python, Node.js, Ruby, .NET, Java SE, Docker, Go
Generic – Windows and Linux Linux Docker Containers
3rd Party Integrations
(as of 01/2016)
Integrate with your CI/CD workflow with open APIs and/or the AWS CLI
Bitbucket & GitHub
Bamboo, CircleCI, CloudBees/Jenkins, Codeship, Solano Labs, Travis CI
Ansible, Chef, Puppet, SaltStack
Any third party or accessible private Docker registry, or Docker Hub
Pricing
No additional charge. Pay for the resources you create to store and run your application.
No additional charge for deployments to EC2 instances. Customers pay $0.02 per on-premises instance update.
No additional charge. Pay for the resources you create to store and run your application.
Learn More
AWS re:Invent 2015(DVO306) AWS CodeDeploy: Automating Your Software Deploymentshttps://www.youtube.com/watch?v=A4NSyUbAEkw
AWS re:Invent 2015(DVO201) Scaling Your Web Applications with AWS Elastic Beanstalkhttps://www.youtube.com/watch?v=nkj0GXgaRv8
AWS re:Invent 2015(CMP302) Amazon ECS: Distributed Applications at Scalehttps://www.youtube.com/watch?v=eun8CqGqdk8
Thank you!