AWS January 2016 Webinar Series - Introduction to Deploying Applications on AWS

34
© 2015, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Warren Santner, Solutions Architect January 26, 2016 Essentials Introduction to Deploying Applications on AWS

Transcript of AWS January 2016 Webinar Series - Introduction to Deploying Applications on AWS

Page 1: AWS January 2016 Webinar Series - Introduction to Deploying Applications on AWS

© 2015, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Warren Santner, Solutions Architect

January 26, 2016

EssentialsIntroduction to Deploying Applications on AWS

Page 2: AWS January 2016 Webinar Series - Introduction 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

Page 3: AWS January 2016 Webinar Series - Introduction to Deploying Applications on AWS

Deployments are Not Easy

• Traditional environments favor in-place upgrades

• Resource constraints• Downtime• Dependencies• Fragile, High-Touch

Processes• Difficult rollback

Page 4: AWS January 2016 Webinar Series - Introduction to Deploying Applications on AWS

Common Deployment Risks

ChallengesApplication failureInfrastructure failureCapacity issuesScaling issuesPeople failureProcess failureRollback issues

Business ImpactsDowntimeData lossBad customer experienceLost revenueGrumpy managersBurned out staffWasted time/resources

Page 5: AWS January 2016 Webinar Series - Introduction to Deploying Applications on AWS

Benefits of Deploying with AWS Services

AWS:• Agile deployments• Flexible options• Scalable capacity• Automation capabilities

Page 6: AWS January 2016 Webinar Series - Introduction to Deploying Applications on AWS

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

Page 7: AWS January 2016 Webinar Series - Introduction to Deploying Applications on AWS

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)

Page 8: AWS January 2016 Webinar Series - Introduction to Deploying Applications on AWS

“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

Page 9: AWS January 2016 Webinar Series - Introduction to Deploying Applications on AWS

AWS Elastic Beanstalkdeploy and scale web applications and services developed with Java, .NET, PHP, Node.js, Python, Ruby, Go, and Docker

Page 10: AWS January 2016 Webinar Series - Introduction to Deploying Applications on AWS

Benefits

Fast & simple to begin

Developer productivity

Impossible to outgrow

Complete resource control

Page 11: AWS January 2016 Webinar Series - Introduction to Deploying Applications on AWS

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

Page 12: AWS January 2016 Webinar Series - Introduction to Deploying Applications on AWS

Platform Support

PHP

Python

Java

Ruby

Node.js

.NET

Go

Docker

Page 13: AWS January 2016 Webinar Series - Introduction to Deploying Applications on AWS

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

Page 14: AWS January 2016 Webinar Series - Introduction to Deploying Applications on AWS

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

Page 15: AWS January 2016 Webinar Series - Introduction to Deploying Applications on AWS

AWS CodeDeployautomate code deployments to any instance, including Amazon EC2 instances and instances running on-premises

Page 16: AWS January 2016 Webinar Series - Introduction to Deploying Applications on AWS

Benefits

Automates Deployments

Minimize Downtime Centralized Control East to Adopt

Page 17: AWS January 2016 Webinar Series - Introduction to Deploying Applications on AWS

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

Page 18: AWS January 2016 Webinar Series - Introduction to Deploying Applications on AWS

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

Page 19: AWS January 2016 Webinar Series - Introduction to Deploying Applications on AWS

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

Page 20: AWS January 2016 Webinar Series - Introduction to Deploying Applications on AWS

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

Page 21: AWS January 2016 Webinar Series - Introduction to Deploying Applications on AWS

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

Page 22: AWS January 2016 Webinar Series - Introduction to Deploying Applications on AWS

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

Page 23: AWS January 2016 Webinar Series - Introduction to Deploying Applications on AWS

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.

Page 24: AWS January 2016 Webinar Series - Introduction to Deploying Applications on AWS

EC2 Container Service Benefits

Cluster Management Made Easy

Performance at Scale

Integrated

Page 25: AWS January 2016 Webinar Series - Introduction to Deploying Applications on AWS

ECS Components

Task Definition

ECS Cluster

Container Instance

Page 26: AWS January 2016 Webinar Series - Introduction to Deploying Applications on AWS

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

Page 27: AWS January 2016 Webinar Series - Introduction to Deploying Applications on AWS

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

Page 28: AWS January 2016 Webinar Series - Introduction to Deploying Applications on AWS

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

Page 29: AWS January 2016 Webinar Series - Introduction to Deploying Applications on AWS

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

Page 30: AWS January 2016 Webinar Series - Introduction to Deploying Applications on AWS

Service Comparison

Page 31: AWS January 2016 Webinar Series - Introduction to Deploying Applications on AWS

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

Page 32: AWS January 2016 Webinar Series - Introduction to Deploying Applications on AWS

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.

Page 33: AWS January 2016 Webinar Series - Introduction to Deploying Applications on AWS

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

Page 34: AWS January 2016 Webinar Series - Introduction to Deploying Applications on AWS

Thank you!