Deploy, Manage, and Scale Your Apps with OpsWorks and Elastic Beanstalk

44
© 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified, or distributed in whole or in part without the express consent of Amazon.com, Inc. Deploy, Manage, and Scale Your Apps with OpsWorks and Elastic Beanstalk Chris Barclay Evan Brown Product Manager Community Manager July 10, 2014

description

AWS offers a number of services that help you easily deploy and run applications in the cloud. Come to this session to learn how to choose among these options. Through interactive demonstrations, this session will show you how to get an application running using AWS OpsWorks and AWS Elastic Beanstalk application management services. You will also learn how to use AWS CloudFormation templates to document, version control, and share your application configuration. This session will cover topics like application updates, customization, and working with resources such as load balancers and databases.

Transcript of Deploy, Manage, and Scale Your Apps with OpsWorks and Elastic Beanstalk

Page 1: Deploy, Manage, and Scale Your Apps with OpsWorks and Elastic Beanstalk

© 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified, or distributed in whole or in part without the express consent of Amazon.com, Inc.

Deploy, Manage, and Scale Your Apps

with OpsWorks and Elastic Beanstalk

Chris Barclay Evan Brown

Product Manager Community Manager

July 10, 2014

Page 2: Deploy, Manage, and Scale Your Apps with OpsWorks and Elastic Beanstalk

What you will learn in this session

• How to choose among the AWS services that

can help you run applications more easily

• How to get an application running using AWS

Elastic Beanstalk and AWS OpsWorks

• How to use AWS CloudFormation templates to

document, version control, and share your

application configuration

Page 3: Deploy, Manage, and Scale Your Apps with OpsWorks and Elastic Beanstalk

1. Make dough

2. Roll and cut the dough

3. Separate donuts from holes

4. Let the dough rise

5. Prepare the glaze

6. Frying time!

7. Let them dry

8. Apply glaze

9. Add sprinkles (optional)

Page 4: Deploy, Manage, and Scale Your Apps with OpsWorks and Elastic Beanstalk

It’s not just deployments…

• How do I scale my environment?

• What is i-dc4297f2 used for?

• How do I know when my application is

unhealthy?

• Where do I get logs?

• Who has SSH access?

Page 5: Deploy, Manage, and Scale Your Apps with OpsWorks and Elastic Beanstalk

You need to

deliver resilient

applications with

less work

Source: http://xkcd.com/844/

Page 6: Deploy, Manage, and Scale Your Apps with OpsWorks and Elastic Beanstalk

Elastic Beanstalk OpsWorks CloudFormation

Application Container Application Automation Templated Provisioning

Page 7: Deploy, Manage, and Scale Your Apps with OpsWorks and Elastic Beanstalk

Jane Doe, Elastic Beanstalk developer

Page 8: Deploy, Manage, and Scale Your Apps with OpsWorks and Elastic Beanstalk

Jane Doe, Elastic Beanstalk developer

• Developer

• Builds web apps, APIs, and handles some

background processing workloads

• Needs some flexibility to customize her app

environments

• Wants simple API to monitor, view logs, scale,

and deploy her apps

Page 9: Deploy, Manage, and Scale Your Apps with OpsWorks and Elastic Beanstalk

The demonstration

• A PHP application that

stores text messages in

a database

• Uses Elastic Load

Balancing and Amazon

RDS

Load-based Auto scaling

PHP

App

Server

PHP

App

Server

PHP

App

Server

Page 10: Deploy, Manage, and Scale Your Apps with OpsWorks and Elastic Beanstalk

Demo time

• Checkout app from GitHub

• Integrate with the eb command line tool

• Deploy from the command line

• View the console

• Change, commit, and deploy

Page 11: Deploy, Manage, and Scale Your Apps with OpsWorks and Elastic Beanstalk

Elastic Beanstalk Supports…

Java PHP Python Ruby .NET Node.js

Page 12: Deploy, Manage, and Scale Your Apps with OpsWorks and Elastic Beanstalk

Deploy Your App for Test

Alert

Log

Mon

Ap

p

AZ

http://your-app.elasticbeanstalk.com

Page 13: Deploy, Manage, and Scale Your Apps with OpsWorks and Elastic Beanstalk

Deploy Your App for Scale

Alert

Log

Mon

Ap

p

AZ

EL

B

http://your-app.elasticbeanstalk.com

Page 14: Deploy, Manage, and Scale Your Apps with OpsWorks and Elastic Beanstalk

Deploy Your Background Processing App

Alert

Log

Mon

Ap

p

AZ

SQS QueueProducers

Page 15: Deploy, Manage, and Scale Your Apps with OpsWorks and Elastic Beanstalk

Deploy With Tools You Know

Page 16: Deploy, Manage, and Scale Your Apps with OpsWorks and Elastic Beanstalk

Deploy With Tools You Know

Page 17: Deploy, Manage, and Scale Your Apps with OpsWorks and Elastic Beanstalk

Deploy With Tools You Know

Alert

Log

Mon

Ap

p

AZ

EL

B

http://your-app.elasticbeanstalk.com

Page 18: Deploy, Manage, and Scale Your Apps with OpsWorks and Elastic Beanstalk

Customize Your Servers, Simply

Page 19: Deploy, Manage, and Scale Your Apps with OpsWorks and Elastic Beanstalk

Customize Your Servers, Simply

Page 20: Deploy, Manage, and Scale Your Apps with OpsWorks and Elastic Beanstalk

Store Sensitive Config, Safely

Alert

Log

Mon

Ap

p

AZ

EL

B

http://your-app.elasticbeanstalk.com

import os

some_var=os.environ.get(‘API_CREDS’)

String some_var = System.getProperty(‘API_CREDS’)

NameValueCollection appConfig = ConfigurationManager.AppSettings;

String param = appConfig[”API_CREDS"];

Python

Java

C#

Page 21: Deploy, Manage, and Scale Your Apps with OpsWorks and Elastic Beanstalk

Store Sensitive Config, Safely

Alert

Log

Mon

Ap

p

AZ

EL

B

http://your-app.elasticbeanstalk.com

import os

some_var=os.environ.get(‘API_CREDS’)

String some_var = System.getProperty(‘API_CREDS’)

NameValueCollection appConfig = ConfigurationManager.AppSettings;

string param = appConfig[”API_CREDS"];

Python

Java

C#

Page 22: Deploy, Manage, and Scale Your Apps with OpsWorks and Elastic Beanstalk

Store Sensitive Config, Safely

Alert

Log

Mon

Ap

p

AZ

EL

B

http://your-app.elasticbeanstalk.com

import os

some_var=os.environ.get(‘API_CREDS’)

String some_var = System.getProperty(‘API_CREDS’)

NameValueCollection appConfig = ConfigurationManager.AppSettings;

string param = appConfig[”API_CREDS"];

Python

Java

C#

Page 23: Deploy, Manage, and Scale Your Apps with OpsWorks and Elastic Beanstalk

John Doe, OpsWorks Developer

Page 24: Deploy, Manage, and Scale Your Apps with OpsWorks and Elastic Beanstalk

John Doe, OpsWorks Developer

• Developer

• Builds apps with broad architectural patterns

and software, e.g. MongoDB and Solr

• Needs a high degree of flexibility to customize

app environments

• Wants APIs to control all aspects of application

operations including deployments and scaling

Page 25: Deploy, Manage, and Scale Your Apps with OpsWorks and Elastic Beanstalk

Benefits

• Any architecture

• Configuration as code

• Automation to run at scale

• Control any component

Page 26: Deploy, Manage, and Scale Your Apps with OpsWorks and Elastic Beanstalk

Dynamic Configuration

Page 27: Deploy, Manage, and Scale Your Apps with OpsWorks and Elastic Beanstalk

Dynamic Configuration

Page 28: Deploy, Manage, and Scale Your Apps with OpsWorks and Elastic Beanstalk

Dynamic Configuration

Page 29: Deploy, Manage, and Scale Your Apps with OpsWorks and Elastic Beanstalk

Dynamic Configuration

Page 30: Deploy, Manage, and Scale Your Apps with OpsWorks and Elastic Beanstalk

Dynamic Configuration

Page 31: Deploy, Manage, and Scale Your Apps with OpsWorks and Elastic Beanstalk

Dynamic Configuration

Page 32: Deploy, Manage, and Scale Your Apps with OpsWorks and Elastic Beanstalk

Dynamic Configuration

Page 33: Deploy, Manage, and Scale Your Apps with OpsWorks and Elastic Beanstalk

Recipes in action

Recipe

+

Metadata

=

Command

execute “mysql-connect” do

command “/usr/bin/mysql

-u#{node[:deploy][:myphpapp][:database][:username]}

-p#{node[:deploy][:myphpapp][:database][:password]}

#{node[:deploy][:myphpapp][:database][:database]}

“deploy”: {

“myphpapp”: {

“database”: {

“username”: “root”,

“password”: “abcxyz”,

“/usr/bin/mysql -uroot –pabcxyz myphpapp …

Page 34: Deploy, Manage, and Scale Your Apps with OpsWorks and Elastic Beanstalk

The demonstration

• The same application

demonstrated with

Elastic Beanstalk

• Also uses Ganglia for

application monitoring Load-based Auto scaling

PHP

App

Server

PHP

App

Server

PHP

App

Server

Ganglia

Server

Page 35: Deploy, Manage, and Scale Your Apps with OpsWorks and Elastic Beanstalk

Demo time

• Model application using layers and apps

• Customize configuration using recipes

• Deployment options

• Review logs

• Manage user permissions

Page 36: Deploy, Manage, and Scale Your Apps with OpsWorks and Elastic Beanstalk

AWS CloudFormation: Model Your App

• Document, version control, and share your

applications and infrastructure as a JSON

document

• Provision app and other AWS resources (VPC,

DynamoDB, etc) from a template

• Repeatable, reliable deployments for

test/dev/prod in any AWS Region

Page 37: Deploy, Manage, and Scale Your Apps with OpsWorks and Elastic Beanstalk

Elastic Beanstalk or OpsWorks Resource

Ap

pE

LB

AZ

your-app.elasticbeanstalk.com

Alert

Log

Mon

Page 38: Deploy, Manage, and Scale Your Apps with OpsWorks and Elastic Beanstalk

Database Resources

Users Table

(DynamoDB)

MySQL Primary

(RDS)

Ap

pE

LB

AZ

your-app.elasticbeanstalk.com

Alert

Log

Mon

Page 39: Deploy, Manage, and Scale Your Apps with OpsWorks and Elastic Beanstalk

Object Storage and Security Resources

Users Table

(DynamoDB)

MySQL Primary

(RDS)

App Storage

(S3)

IAM Instance Profile

Ap

pE

LB

AZ

your-app.elasticbeanstalk.com

Alert

Log

Mon

Page 40: Deploy, Manage, and Scale Your Apps with OpsWorks and Elastic Beanstalk

Deployed as a CloudFormation Stack

Users Table

(DynamoDB)

MySQL Primary

(RDS)

App Storage

(S3)

IAM Instance Profile

Ap

pE

LB

AZ

your-app.elasticbeanstalk.com

Alert

Log

Mon

Page 41: Deploy, Manage, and Scale Your Apps with OpsWorks and Elastic Beanstalk

Modeled in a Template File

Users Table

(DynamoDB)

MySQL Primary

(RDS)

App Storage

(S3)

IAM Instance Profile

Ap

pE

LB

AZ

your-app.elasticbeanstalk.com

Alert

Log

Mon

CloudFormation

Template

Page 42: Deploy, Manage, and Scale Your Apps with OpsWorks and Elastic Beanstalk

What we discussed

• How to choose among the AWS services that

can help you run applications more easily

• How to get an application running using AWS

Elastic Beanstalk and AWS OpsWorks

• How to use AWS CloudFormation templates to

document, version control, and share your

application configuration

Page 43: Deploy, Manage, and Scale Your Apps with OpsWorks and Elastic Beanstalk

Learn MoreGet started with Elastic Beanstalk

http://amzn.to/1dh8QkU

Follow us @aws_eb

Get started with OpsWorks

http://amzn.to/1bSHOPN

Follow us @AWSOpsWorks

Get started with CloudFormation

http://amzn.to/1m11Z3K

Follow us at @AWSCloudFormer

Page 44: Deploy, Manage, and Scale Your Apps with OpsWorks and Elastic Beanstalk

Thank You!