26
November 12, 2014 | Las Vegas, NV APP201 Going Zero to Sixty with AWS Elastic Beanstalk Abhishek Singh, Product Manager, Amazon Web Services

(APP201) Going Zero to Sixty with AWS Elastic Beanstalk | AWS re:Invent 2014

Embed Size (px)

DESCRIPTION

"AWS Elastic Beanstalk provides an easy way for you to quickly deploy, manage, and scale applications in the AWS cloud. This session shows you how to deploy your code to AWS Elastic Beanstalk, easily enable or disable application functionality, and perform zero-downtime deployments through interactive demos and code samples for both Windows and Linux. Are you new to AWS Elastic Beanstalk? Get up to speed for this session by first completing the 60-minute Fundamentals of AWS Elastic Beanstalk lab in the self-paced Lab Lounge."

Citation preview

Page 1: (APP201) Going Zero to Sixty with AWS Elastic Beanstalk | AWS re:Invent 2014

November 12, 2014 | Las Vegas, NV

APP201

Going Zero to Sixty with AWS Elastic

BeanstalkAbhishek Singh, Product Manager, Amazon Web Services

Page 2: (APP201) Going Zero to Sixty with AWS Elastic Beanstalk | AWS re:Invent 2014

AWS Elastic Beanstalk (EB)

We believe in helping developers

deploy and maintain scalable web

applications and services in the

cloud without worrying about the

underlying infrastructure.

Page 3: (APP201) Going Zero to Sixty with AWS Elastic Beanstalk | AWS re:Invent 2014

AWS Elastic Beanstalk (EB)

Page 4: (APP201) Going Zero to Sixty with AWS Elastic Beanstalk | AWS re:Invent 2014

Basic concepts

(10m)

Developer workflow

(10m)

Demo(15m)

Advanced topics

(10m)

Flow

Page 5: (APP201) Going Zero to Sixty with AWS Elastic Beanstalk | AWS re:Invent 2014

Basic concepts

Page 6: (APP201) Going Zero to Sixty with AWS Elastic Beanstalk | AWS re:Invent 2014

Elastic Beanstalk object model

Application

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

Page 7: (APP201) Going Zero to Sixty with AWS Elastic Beanstalk | AWS re:Invent 2014

Elastic Beanstalk environment

• 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)

Page 8: (APP201) Going Zero to Sixty with AWS Elastic Beanstalk | AWS re:Invent 2014

On-instance configuration

Your code

HTTP server

Application server

Language interpreter

Operating system

Host

Focus on building your

application

Page 9: (APP201) Going Zero to Sixty with AWS Elastic Beanstalk | AWS re:Invent 2014

Application versions and saved configurations

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!

Page 10: (APP201) Going Zero to Sixty with AWS Elastic Beanstalk | AWS re:Invent 2014

Developer workflow

Page 11: (APP201) Going Zero to Sixty with AWS Elastic Beanstalk | AWS re:Invent 2014

Deployment options

1. Via the AWS Management Console

2. Via Git / EB CLI

3. Via the AWS Toolkit for Eclipse and the

Visual Studio IDE

$ git aws.push

Page 12: (APP201) Going Zero to Sixty with AWS Elastic Beanstalk | AWS re:Invent 2014

Deployment configuration

Region01

Stack (container) type02

Single instanceLoad balanced with

Auto Scaling03 OR

Database (RDS)04 Optional

Your code

Page 13: (APP201) Going Zero to Sixty with AWS Elastic Beanstalk | AWS re:Invent 2014

Example: CLI workflow

• AWS account – your access and secret keys

• EB CLI

• Linux / Unix / Mac: Python 2.7 or 3.0

• Windows PowerShell 2.0

• A credential file containing info from 1

• Git 1.66 or later (optional)

Page 14: (APP201) Going Zero to Sixty with AWS Elastic Beanstalk | AWS re:Invent 2014

Example: CLI workflow

$ git init . $ git add .

Initialize your Git repository01 Add your code04

$ eb init $ git commit –m “v1.0”

Create your Elastic Beanstalk app02 Commit05

Follow the prompts to configure the

environment03

Create the resources and launch the

application06

$ eb create

Page 15: (APP201) Going Zero to Sixty with AWS Elastic Beanstalk | AWS re:Invent 2014

Example: CLI workflow

Update your code01

$ git add .$ git commit –m “v2.0”$ eb deploy

Push the new code 02

Monitor the deployment progress03

$ eb status

Page 16: (APP201) Going Zero to Sixty with AWS Elastic Beanstalk | AWS re:Invent 2014

Example: Deploy Docker container to EB

Dockerfile

Dockerrun.aws.json

Page 17: (APP201) Going Zero to Sixty with AWS Elastic Beanstalk | AWS re:Invent 2014

Example: Deploy Docker container to EB

$ git init .

Initialize your Git repository01

$ git add Dockerfile

Add your code04

$ eb init

Create your Elastic Beanstalk app02

$ git commit –am “v1.0”

Commit05

Follow the prompts to configure the

environment and copy Dockerfile03 06

Create the resources and launch the

application

$ eb create

Page 18: (APP201) Going Zero to Sixty with AWS Elastic Beanstalk | AWS re:Invent 2014

Demo

Page 19: (APP201) Going Zero to Sixty with AWS Elastic Beanstalk | AWS re:Invent 2014

Advanced topics

Page 20: (APP201) Going Zero to Sixty with AWS Elastic Beanstalk | AWS re:Invent 2014

Add custom software to your environment using ebextensions:

Customize application containers

packages:yum:newrelic-sysmond: []

rpm:newrelic: http://yum.newrelic.com/pub/newrelic/el5/i386/newrelic-repo-5-3.noarch.rpm

commands:0_newrelic_command:command: "touch /tmp/$(date '+%F.%T.%N').newrelic_command_0"

1_configure_new_relic_key:command: nrsysmond-config --set license_key=<Your key here>

1a_newrelic_command:command: "touch /tmp/$(date '+%F.%T.%N').newrelic_command_1a"

2_start_new_relic:command: "/etc/init.d/newrelic-sysmond start"

2a_newrelic_command:command: "touch /tmp/$(date '+%F.%T.%N').newrelic_command_2a"

Page 21: (APP201) Going Zero to Sixty with AWS Elastic Beanstalk | AWS re:Invent 2014

Iterate on application architecture

Add additional resources to your environments using ebextensions:

Add other components such as:

• In-memory caching (Amazon

ElastiCache Redis and

Memcached)

• Amazon SQS

• Amazon CloudFront

Resources:MyElastiCache:Type: AWS::ElastiCache::CacheClusterProperties:CacheNodeType:

Fn::GetOptionSetting:OptionName : CacheNodeTypeDefaultValue: cache.m1.small

NumCacheNodes: Fn::GetOptionSetting:OptionName : NumCacheNodesDefaultValue: 1

Engine: Fn::GetOptionSetting:OptionName : EngineDefaultValue: memcached

Page 22: (APP201) Going Zero to Sixty with AWS Elastic Beanstalk | AWS re:Invent 2014

Zero-downtime deployments

Swap URLs

1. Create a new environment for an existing application

2. Deploy your updated application code to the new environment

3. Use the “Swap URLs” feature to transition users to the new

production environment

Page 23: (APP201) Going Zero to Sixty with AWS Elastic Beanstalk | AWS re:Invent 2014

Benefits of Elastic Beanstalk

Focus on your application

Focus on what makes your business unique

Focus on innovation, not undifferentiated heavy lifting

Spend developer time in the right place

Automate as much as you can

Page 24: (APP201) Going Zero to Sixty with AWS Elastic Beanstalk | AWS re:Invent 2014

There’s no additional charge for Elastic Beanstalk

Page 25: (APP201) Going Zero to Sixty with AWS Elastic Beanstalk | AWS re:Invent 2014

Learn more

http://amzn.to/10JK5dm

http://bit.ly/1o6PwZm

@aws_eb

Page 26: (APP201) Going Zero to Sixty with AWS Elastic Beanstalk | AWS re:Invent 2014

Please give us your feedback on this session.

Complete session evaluations and earn re:Invent swag.

http://bit.ly/awsevals