Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

AWS July Webinar Series-Deploying and Scaling Web Application with AWS Elastic Beanstalk

1,673 views

Published on

Want to easily deploy your Node.js, Ruby, Python, .NET, Tomcat, PHP or Docker web applications to AWS?

AWS Elastic Beanstalk is a service that makes it easy to deploy, scale, and manage your web applications on AWS by providing preconfigured application stacks and managing the underlying infrastructure on your behalf. You simply select the application stack you want and upload your code to get started.

This webinar will familiarize you with how to deploy your web application to AWS using AWS Elastic Beanstalk (EB). We will walk through the steps necessary to debug, test and scale your application to handle millions of web requests. Also, you will learn about deployment options, cost management, and ongoing monitoring and maintenance.

Learning Objectives:

Understand the benefits of AWS Elastic Beanstalk versus do-it-yourself
Deploy a sample Node.js application using the Elastic Beanstalk command line interface
Modify application stack configuration and extend your application to use additional AWS resources (e.g.: DynamoDB, SNS, etc.)
Debug, load test, and scale the sample application to handle millions of web requests
Use deployment options available for zero downtime deployments (in-place and blug/green)
Use tags for cost management

Published in: Technology

AWS July Webinar Series-Deploying and Scaling Web Application with AWS Elastic Beanstalk

  1. 1. © 2015, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Abhishek Singh, Senior Product Manager – AWS Elastic Beanstalk 7/29/2015 Deploying and Scaling Web Application with AWS Elastic Beanstalk (EB)
  2. 2. After this session, you should be able to: • Understand the benefits of using AWS Elastic Beanstalk vs. do it yourself • Deploy a sample Node.js application using the Elastic Beanstalk command line interface • Use tags for cost management • Modify application stack configuration and extend your application to use additional AWS resources (e.g.: DynamoDB, SNS, etc.) • Debug, load test, and scale the sample application to handle millions of web requests • Use deployment options available for zero downtime deployments (in-place and blue/green) • Set up alarms to monitor you running applications
  3. 3. AWS Elastic Beanstalk vs. Do It Yourself • Preconfigured Infrastructure • Single Instance (Dev, Low Cost) • Load Balanced, Auto Scaling (Production) • Web Server & Worker tiers • Elastic Beanstalk provisions necessary infrastructure resources such as the load balancer, auto scaling group, security groups, database (optional), etc. • Provides a unique domain name for your application (e.g.: youapp.elasticbeanstalk.com)
  4. 4. AWS Elastic Beanstalk vs. Do It Yourself Your code HTTP Server Application Server Language Interpreter Operating System Host 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 you application stack. Focus on building your application Provided by you Provided and managed by AWS Elastic Beanstalk (EB)
  5. 5. Deployment Options 1. Via AWS Management Console 2. Via Git / EB CLI 3. Via AWS Toolkit for Eclipse and Visual Studio IDE $ eb deploy
  6. 6. Deployment Configuration Region01 Stack (container) type02 Single Instance Load Balanced with auto-scaling 03 OR Database (RDS)04 Optional Your code
  7. 7. Deploy Sample Node.js Application Initial application deployment workflow $ git clone https://github.com/awslabs/eb- node-express-sample.git Download sample application02 $ eb init Create your Elastic Beanstalk app03 Follow the prompts to configure the environment 04 05 Create the resources and launch the application $ eb create $ pip install --upgrade awsebcli Install the AWS Elastic Beanstalk command line interface (EB CLI) 01
  8. 8. Update Sample Node.js Application Update application workflow Update your code01 $ git add . $ git commit –m “v2.0” $ eb deploy Add & commit code to repository02 Open application once deployment completes. 03 $ eb open
  9. 9. Demo
  10. 10. Sample Application Details How to configure/customize an environment using ebextensions https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customize-containers-ec2.html
  11. 11. options.config option_settings: aws:elasticbeanstalk:customoption: AlarmEmail: "nobody@amazon.com" aws:elasticbeanstalk:application:environment: THEME: "flatly" AWS_REGION: '`{ "Ref" : "AWS::Region"}`' STARTUP_SIGNUP_TABLE: '`{ "Ref" : "StartupSignupsTable"}`' NEW_SIGNUP_TOPIC: '`{ "Ref" : "NewSignupTopic"}`' aws:elasticbeanstalk:container:nodejs: ProxyServer: nginx aws:elasticbeanstalk:container:nodejs:staticfiles: /static: /static
  12. 12. Sample Application Details How to add additional AWS resources (e.g.: DynamoDB, SNS, SQS, etc.) using ebextensions https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/environment-resources.html
  13. 13. resources.config Resources: StartupSignupsTable: Type: AWS::DynamoDB::Table Properties: KeySchema: HashKeyElement: {AttributeName: email, AttributeType: S} ProvisionedThroughput: {ReadCapacityUnits: 1, WriteCapacityUnits: 1} NewSignupQueue: Type: AWS::SQS::Queue NewSignupTopic: Type: AWS::SNS::Topic Properties: Subscription: - Endpoint: Fn::GetOptionSetting: {DefaultValue: nobody@amazon.com, OptionName: NewSignupEmail} Protocol: email - Endpoint: Fn::GetAtt: [NewSignupQueue, Arn] Protocol: sqs
  14. 14. resources.config (cont.) AllowSNS2SQSPolicy: Type: AWS::SQS::QueuePolicy Properties: PolicyDocument: Id: PublicationPolicy Statement: - Action: ['sqs:SendMessage'] Condition: ArnEquals: aws:SourceArn: {Ref: NewSignupTopic} Effect: Allow Principal: {AWS: '*'} Resource: Fn::GetAtt: [NewSignupQueue, Arn] Sid: Allow-SNS-SendMessage Version: '2008-10-17' Queues: - {Ref: NewSignupQueue}
  15. 15. Best Practices
  16. 16. Tag your environments • Makes it easy to find resources belonging to a given environment. • Can be used to monitor costs associated with a given environment and/or application. • AWS Elastic Beanstalk automatically tags environments with: • Environment Name • Environment ID
  17. 17. Testing/Tuning Your Application • Make sure to load test your application. Set auto-scaling minimum and maximum to 1 while load testing. This ensures that you test and understand how your application degrades under load. • Configure auto-scaling trigger to optimize performance metric (e.g.: latency, number of web request per second, etc.). • Tune backend (DynamoDB, RDS, etc.) throughput for optimal performance leaving enough headroom.
  18. 18. Deployment Options Blue/Green deployments Pros: • Fast rollback as environment running the previous version has not been modified in any way. • Ensures no state build up on environments. Cons: • Longer deployment times (2-5 min.) as new environment must be created. • Clients (i.e.: mobile devices) may cache DNS addresses and not respect DNS TTL. This results in staggered/non-deterministic traffic rollover to new environment.
  19. 19. Deployment Options Rolling deployments Pros: • Fast deployment times (20-60 sec.) Cons: • Slower rollback as previous application version must be re-deployed. • Possibility of state build up on long running environments.
  20. 20. Metrics & Alarms • Understand metrics available for your environment and what they mean. • Setup alarms to automatically monitor critical metrics and send notifications when metrics are outside normal operating range.
  21. 21. Demo

×