Amazon Web Services - Elastic Beanstalk

31
Amazon Web Services – Elastic Beanstalk Jeff Barr – Senior Evangelist @jeffbarr

description

In this presentation, Jeff Barr introduces AWS, with a focus on EC2, and then shows how to use AWS Elastic Beanstalk with Git-based deployment of a PHP application.

Transcript of Amazon Web Services - Elastic Beanstalk

Page 1: Amazon Web Services - Elastic Beanstalk

Amazon Web Services – Elastic BeanstalkJeff Barr – Senior Evangelist

@jeffbarr

Page 2: Amazon Web Services - Elastic Beanstalk

My Background

Education:• BS in Computer Science, The American University, 1985• Grad student in Digital Media, University of Washington, 2010-Present

Background:• Microsoft Visual Studio team• Consulting to startups and VC’s• Amazon employee since 2002

Author, “Host Your Web Site in the Cloud”

Email: [email protected]

Twitter: @jeffbarr

Copyright © 2011, Amazon Web Services LLC or its affiliates. All rights reserved.

Page 3: Amazon Web Services - Elastic Beanstalk

What You Will Learn

• What are the Amazon Web Services?

• What are the principal AWS components?

• How do they fit together?

• How can I use AWS Elastic Beanstalk?

Page 4: Amazon Web Services - Elastic Beanstalk

Amazon Web Services

• Launched in 2006

• Hundreds of thousands of customers in 190 countries

• Building-block IT services

• Sign up with a credit card at http://aws.amazon.com

Page 5: Amazon Web Services - Elastic Beanstalk

AWS PLATFORM

Cloud-Powered Applications

Management & AdministrationAdministration

ConsoleIdentity & Access

Deployment Monitoring

Application Platform ServicesContent

DistributionMessaging

Parallel Processing

Libraries & SDKs

Foundation Services

Compute Storage Database Networking

Global Infrastructure

Availability Zones

RegionsEdge Locations

Page 6: Amazon Web Services - Elastic Beanstalk

AWS Management Console

Page 7: Amazon Web Services - Elastic Beanstalk

Region

Availability Zone

Amazon EC2 Architecture

EC2 Instance

Elastic IP Address

Security Group(s)

Load Balancing

Elastic Block

StorageCloudWatch

Auto Scaling

Ephemeral Storage

Amazon S3

EBS Snapshot

EBS Snapshot

Amazon Machine

Image (AMI)

Page 8: Amazon Web Services - Elastic Beanstalk

EC2 – Regions and Availability Zones

Region – One of 7 distinct physical locations:

• Northern Virginia, San Francisco, Oregon, Tokyo, Singapore, Brazil, Ireland

Availability Zone• Physical infrastructure (1 or more data centers)• 2 or more AZ’s per Region• Fault tolerance across AZ’s

Page 9: Amazon Web Services - Elastic Beanstalk

EC2 Instance

• Amazon EC2: A Virtual Server in the Cloud

• Provision and boot new servers in minutes

• Boot from AMI (Amazon Machine Image)

• Your choice of Linux or Windows

• Quickly scale capacity up or down

• Deploy across Regions and Availability Zones for reliability

• Choose from 14 different instance types:

• CPU power

• RAM

• Local disk

• Network speed

Page 10: Amazon Web Services - Elastic Beanstalk
Page 11: Amazon Web Services - Elastic Beanstalk

EC2 Security Group

• Virtual firewall• Control access to instance• Default configuration: no access

Page 12: Amazon Web Services - Elastic Beanstalk

EC2 Elastic IP Address

• Fixed IP address• Map to any EC2 instance in a Region• Retain address after switching instances

Page 13: Amazon Web Services - Elastic Beanstalk

EC2 Elastic Load Balancer

Distribute traffic to an array of EC2 instances• Scale up or scale down• Health checks• Traffic goes to healthy instances• Configurable list of ports

Page 14: Amazon Web Services - Elastic Beanstalk

Amazon CloudWatch

• Tracks and stores AWS and user-defined metrics• 2 week retention period• Detect issues• Raise alerts

Page 15: Amazon Web Services - Elastic Beanstalk

EC2 Auto Scaling

• Control number of running EC2 instances• Scale up or down as needed• Drive decisions based on CloudWatch metrics

• CPU load• Network traffic

• No direct console UI at present:• Command line• API• Elastic Beanstalk

• Auto-scaling group• Instance collection• Actions (rules)

Page 16: Amazon Web Services - Elastic Beanstalk

EC2 Elastic Block Storage (EBS)

• Virtual disk volumes• 1 GB – 1 TB per volume• Create and attach to EC2 instance• Format and write data• Snapshot and restore• Provison desired IOPS (up to 1000 per volume)

Page 17: Amazon Web Services - Elastic Beanstalk

What’s Next?So…those are all of the parts!

Can we put them all together?

Page 18: Amazon Web Services - Elastic Beanstalk

AWS Elastic Beanstalk- Intro

• Easy to deploy and manage applications in AWS• Application Container / PaaS (Platform-as-a-Service)• Get started at no charge (free usage tier)

• You:• Create and upload application

• Elastic Beanstalk:• Capacity provisioning (EC2)• Load balancing (ELB)• Auto-scaling (Auto Scaling)• Application health monitoring (CloudWatch)

Page 19: Amazon Web Services - Elastic Beanstalk

AWS Elastic Beanstalk - Environments

.NET

• AWS SDK for .NET• Visual Studio Toolkit• Microsoft Web Deploy• Upload ZIP• Microsoft Windows + IIS

Java

AWS SDK for Java

Eclipse Toolkit

Upload WAR file

Linux + Tomcat + Apache

PHP

• AWS SDK for PHP• Existing dev tools• Git-based deployment• GIT PUSH• Linux + Apache

Page 20: Amazon Web Services - Elastic Beanstalk

AWS Elastic Beanstalk – Development & Deployment

Page 21: Amazon Web Services - Elastic Beanstalk

AWS Elastic Beanstalk in Action (1)

Create some code (index.php)

Check code into Git:

<devserver>: git initInitialized empty Git repository in /home/jeff/jeffbarr_core/projects/bs_demo_1/.git/

<devserver>: git add .

<devserver>: git commit -m"Initial check-in."[master (root-commit) fc57da3] Initial check-in. 1 files changed, 8 insertions(+), 0 deletions(-) create mode 100644 index.php

Page 22: Amazon Web Services - Elastic Beanstalk

AWS Elastic Beanstalk in Action (2)

Create Beanstalk Application

Page 23: Amazon Web Services - Elastic Beanstalk

AWS Elastic Beanstalk in Action (2)

Wait for Application to Launch (Several Minutes)

Page 24: Amazon Web Services - Elastic Beanstalk

AWS Elastic Beanstalk in Action (3)

Page 25: Amazon Web Services - Elastic Beanstalk

AWS Elastic Beanstalk in Action (4)

Install and configure AWS DevTools

<devserver>: git aws.configAWS Access Key: ……………………AWS Secret Key: ……………………………AWS Region: us-east-1AWS Elastic Beanstalk Application: My First Elastic Beanstalk ApplicationAWS Elastic Beanstalk Environment: Default-Environment

Page 26: Amazon Web Services - Elastic Beanstalk

AWS Elastic Beanstalk in Action (5)

Push new application code:

<devserver>: git aws.pushCounting objects: 3, done.Compressing objects: 100% (2/2), done.Writing objects: 100% (3/3), 307 bytes, done.Total 3 (delta 0), reused 0 (delta 0)remote:To https://180P9FEG65H0CMCANER2:20120601T212315Zac4b3d5b9f887ae461b3079927762543d94a83855a2ad0beed66b2c27b3b435e@git.elasticbeanstalk.us-east-1.amazonaws.com/repos/4d7920466972737420456c6173746963204265616e7374616c6b204170706c6963617469\6f6e/Default-Environment

Page 27: Amazon Web Services - Elastic Beanstalk

AWS Elastic Beanstalk in Action (6)

Page 28: Amazon Web Services - Elastic Beanstalk

AWS Elastic Beanstalk in Action (7)

Page 29: Amazon Web Services - Elastic Beanstalk

AWS Free Usage Tier

Page 30: Amazon Web Services - Elastic Beanstalk

Next Steps for You

• Sign up for free account at http://aws.amazon.com/free/

• Build and deploy your first PHP application

• Read AWS blog at http://aws.typepad.com

• Send questions my way – [email protected]

Page 31: Amazon Web Services - Elastic Beanstalk

Thanks for Listening!

[email protected]

@jeffbarr