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.

Deploy, Scale and Manage your Application with AWS Elastic Beanstalk

994 views

Published on

by Adhiraj Singh, Sr. Product Manager, AWS

  • Writing a good research paper isn't easy and it's the fruit of hard work. For help you can check writing expert. Check out, please ⇒ www.HelpWriting.net ⇐ I think they are the best
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • I pasted a website that might be helpful to you: ⇒ www.WritePaper.info ⇐ Good luck!
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Writing good research paper is quite easy and very difficult simultaneously. It depends on the individual skill set also. You can get help from research paper writing. Check out, please ⇒ www.HelpWriting.net ⇐
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

Deploy, Scale and Manage your Application with AWS Elastic Beanstalk

  1. 1. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved Managing your web applications with AWS Elastic Beanstalk Adhiraj Singh Sr. Product Manager | AWS Elastic Beanstalk
  2. 2. Agenda • Elastic Beanstalk Introduction • Elastic Beanstalk vs. DIY • Getting started with Elastic Beanstalk • Demo – Sample Application • Custom Platforms • Best Practices • Deployment options • Managed Updated • Auto Scaling • Other tips
  3. 3. Developer challenges • Complexity of deploying code, provisioning and managing infrastructure • Expertise and time needed to manage and configure servers, databases, load balancers, firewalls, and networks • How to automate application scaling • Lack of consistency across teams
  4. 4. What is Elastic Beanstalk? AWS Elastic Beanstalk is an easy-to-use service for deploying, scaling, and managing web applications and services.
  5. 5. 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. Focus on building your application Provided by you Provided and managed by AWS Elastic Beanstalk (EB) On-instance configuration
  6. 6. AWS Elastic Beanstalk vs. Do It Yourself • Preconfigured Infrastructure • Single Instance (Dev, Low Cost) • Load Balanced, Auto Scaling (Production) • Web & 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.regionx.elasticbeanstalk.com) Infrastructure stack
  7. 7. Elastic Beanstalk benefits Fast & simple to begin Developer productivity/agility Impossible to outgrow Complete resource control No additional charge to use Elastic Beanstalk. You pay only for underlying AWS resources (i.e., EC2 instances, S3, etc.)
  8. 8. Common use cases Websites API backends Mobile backends Asynchronous Workers
  9. 9. How do I get started with Elastic Beanstalk?
  10. 10. Information required to deploy application 01 02 03 04 Region Stack (container) type Single Instance Load Balanced with Auto ScalingOR Database (RDS) Your code Optional Supported Platforms Custom Platforms Create and manage your own custom Elastic Beanstalk platforms for greater control over the AMI, metadata, and configuration options.
  11. 11. Building blocks Application Application Versions ( V1, V2, …,Vx) Environment 1 Environment 2 Environment .. n
  12. 12. How to deploy applications 1. Via AWS Management Console 2. Via AWS Toolkit for Eclipse and Visual Studio IDE 3. Via AWS SDKs and CLI 4. Via EB command line interface $ eb deploy
  13. 13. Deploy sample application (EB CLI) 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
  14. 14. Update sample application (EB CLI) 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
  15. 15. Sample application details • Application dependency management • Configuring/customizing an environment using ebextensions • Choosing a remote source repository: AWS CodeCommit • Adding additional AWS resources (e.g.: DynamoDB, SNS, SQS etc.)
  16. 16. Demo
  17. 17. Custom Platform • Create and manage your own custom Elastic Beanstalk platforms • Get greater control over the AMI, metadata, and configuration • Enforce and manage standardization/best practices across environments (without the need for .ebextensions)
  18. 18. Custom Platform For example: you can now create your own platforms on Ubuntu or Red Hat Enterprise and customize your instances with languages/frameworks currently not supported by Elastic Beanstalk e.g. Rust, Sinatra etc. For example: you can now create your own platform that runs multiple Docker containers, uses encrypted AMIs or custom disk layouts e.g. multiple volumes, EFS mounts etc.
  19. 19. Custom Platform Creating a Custom Platform: • Uses Packer: an open-source toll for creating machine images • Methods: EB CLI, API, SDK • Platform Definition archive • Packer template: • Platform definition file: platform.yml • Builder: • EB CLI: • eb platform init • eb platform create • An environment called 'eb-custom-platform-builder-packer' is created in order to build the platform. This environment will not terminated automatically. Once your platform creation has completed, you can terminate this builder environment using the command “eb terminate”
  20. 20. Custom Platform Using a Custom Platform in a user environment: • Methods: AWS Management console, EB CLI, API, SDK • EB CLI: • eb init • select option “Custom Platform” for the question “select a platform” • eb create • Console:
  21. 21. Best practices • Deployment options • Managed Platform Updates • Auto Scaling • Other tips
  22. 22. Deployment options * Default method ^ ”All at Once” Method used Environment Type Deployment category Method All at Once* Immutable (New) Disabled*^ Immutable (New) All at Once Rolling* Rolling with additional batch Immutable Disabled^ Rolling based on Health* Rolling based on Time Immutable Single Instance Load Balanced/Auto-Scaled Application Platform/Configuration Application Platform/Configuration
  23. 23. All at once: step 0 Auto Scaling Group Elastic Beanstalk Environment v1 v1 myapp.us-east-1.elasticbeanstalk.com v1v1
  24. 24. All at once: step 1 Auto Scaling Group Elastic Beanstalk Environment v2 v2 myapp.us-east-1.elasticbeanstalk.com v2v2
  25. 25. All at once: step 2 Auto Scaling Group Elastic Beanstalk Environment v2 v2 myapp.us-east-1.elasticbeanstalk.com v2v2
  26. 26. Rolling: step 0 Auto Scaling Group Elastic Beanstalk Environment v1 v1 myapp.us-east-1.elasticbeanstalk.com v1v1
  27. 27. Rolling: step 1 Auto Scaling Group Elastic Beanstalk Environment v2 v2 myapp.us-east-1.elasticbeanstalk.com v1v1
  28. 28. Rolling: step 2 Auto Scaling Group Elastic Beanstalk Environment v2 v2 myapp.us-east-1.elasticbeanstalk.com v1v1
  29. 29. Rolling: step 3 Auto Scaling Group Elastic Beanstalk Environment v2 v2 myapp.us-east-1.elasticbeanstalk.com v2v2
  30. 30. Rolling: step 4 Auto Scaling Group Elastic Beanstalk Environment v2 v2 myapp.us-east-1.elasticbeanstalk.com v2v2
  31. 31. Rolling with additional batch: step 0 Auto Scaling Group Elastic Beanstalk Environment v1 v1 myapp.us-east-1.elasticbeanstalk.com v1v1
  32. 32. Rolling with additional batch: step 1 Auto Scaling Group Elastic Beanstalk Environment v2 v2 v1 v1 myapp.us-east-1.elasticbeanstalk.com v1v1
  33. 33. Rolling with additional batch: step 2 Auto Scaling Group Elastic Beanstalk Environment v2 v2 v1 v1 myapp.us-east-1.elasticbeanstalk.com v1v1
  34. 34. Rolling with additional batch: step 3 Auto Scaling Group Elastic Beanstalk Environment v2 v2 v2 v2 myapp.us-east-1.elasticbeanstalk.com v1v1
  35. 35. Rolling with additional batch: step 4 Auto Scaling Group Elastic Beanstalk Environment v2 v2 v2 v2 myapp.us-east-1.elasticbeanstalk.com v1v1
  36. 36. Rolling with additional batch: step 5 Auto Scaling Group Elastic Beanstalk Environment v2 v2 v2 v2 myapp.us-east-1.elasticbeanstalk.com v1v1
  37. 37. Rolling with additional batch: step 6 Auto Scaling Group Elastic Beanstalk Environment v2 v2 myapp.us-east-1.elasticbeanstalk.com v2v2
  38. 38. Immutable: step 0 Auto Scaling Group Elastic Beanstalk Environment v1 v1 myapp.us-east-1.elasticbeanstalk.com v1v1
  39. 39. Immutable: step 1 Auto Scaling Group Elastic Beanstalk Environment v1 v1 myapp.us-east-1.elasticbeanstalk.com v1v1 Auto Scaling Group v2
  40. 40. Immutable: step 2 Auto Scaling Group Elastic Beanstalk Environment v1 v1 myapp.us-east-1.elasticbeanstalk.com v1v1 Auto Scaling Group v2
  41. 41. Immutable: step 3 Auto Scaling Group Elastic Beanstalk Environment v1 v1 myapp.us-east-1.elasticbeanstalk.com v1v1 Auto Scaling Group v2 v2 v2v2
  42. 42. Immutable: step 4 Auto Scaling Group Elastic Beanstalk Environment v1 v1 myapp.us-east-1.elasticbeanstalk.com v1v1 Auto Scaling Group v2 v2 v2v2
  43. 43. Immutable: step 5 Auto Scaling Group Elastic Beanstalk Environment v1 v1 myapp.us-east-1.elasticbeanstalk.com v1v1 Auto Scaling Group v2 v2 v2v2
  44. 44. Immutable: step 6 Elastic Beanstalk Environment myapp.us-east-1.elasticbeanstalk.com Auto Scaling Group v2 v2 v2v2
  45. 45. Immutable: step 6 Auto Scaling Group Elastic Beanstalk Environment v2 v2 myapp.us-east-1.elasticbeanstalk.com v2v2
  46. 46. Blue/Green: step 0 Auto Scaling Group Elastic Beanstalk Environment v1 v1 myapp.us-east-1.elasticbeanstalk.com v1v1
  47. 47. Blue/Green: step 1 Auto Scaling Group Elastic Beanstalk Environment v1 v1 myapp.us-east-1.elasticbeanstalk.com v1v1 Auto Scaling Group Elastic Beanstalk Environment v1 v1 myapp_new.us-east-1.elasticbeanstalk.com v1v1 Cloned environment
  48. 48. Blue/Green: step 2 Auto Scaling Group Elastic Beanstalk Environment v2 V2 myapp_new.us-east-1.elasticbeanstalk.com v2v2 Cloned environment
  49. 49. Blue/Green: step 3 Auto Scaling Group Elastic Beanstalk Environment v2 V2 myapp_new.us-east-1.elasticbeanstalk.com v2v2 Cloned environment
  50. 50. Blue/Green: step 3 Cloned environment Auto Scaling Group Elastic Beanstalk Environment v2 V2 myapp_new.us-east-1.elasticbeanstalk.com v2v2
  51. 51. Blue/Green: step 4
  52. 52. Blue/Green: step 5 Auto Scaling Group Elastic Beanstalk Environment v1 v1 myapp.us-east-1.elasticbeanstalk.com v1v1 Cloned environment Auto Scaling Group Elastic Beanstalk Environment v2 V2 myapp_new.us-east-1.elasticbeanstalk.com v2v2
  53. 53. Blue/Green: step 6 Auto Scaling Group Elastic Beanstalk Environment v1 v1 myapp_new.us-east-1.elasticbeanstalk.com v1v1 Cloned environment Auto Scaling Group Elastic Beanstalk Environment v2 V2 myapp.us-east-1.elasticbeanstalk.com v2v2
  54. 54. Application deployment options Method Impact of failed deployment Deploy Time Zero Downtime No DNS Change Rollback process Code Deployed To All at Once Downtime  X  Re-deploy Existing instances Rolling Single batch out of service. Any successful batches prior to failure running new application version ♦   Re-deploy Existing instances Rolling with additional batch Minimum if first batch fails, otherwise similar to Rolling ♦   Re-deploy New & existing instances Immutable Minimal    Re-deploy New instances Blue/Green Minimal   X Swap URL New instances  Options available for both Single Instance and Load Balanced/Auto-Scaled Environments ♦ Varies depending on instance batch size
  55. 55. Managed Platform Update Configure your environment to automatically upgrade to the latest version of a platform during a scheduled maintenance window. • Permissions • Maintenance Window • Minor and Patch Updates Key benefits: • Automated Upgrades • No/Minimal downtime • No/Minimal impact on capacity • Flexibility of manual updates • Instance replacement
  56. 56. Demo Managed updates
  57. 57. Auto Scaling Min/Max instances Availability Zones Scaling cooldown Triggers based scaling Trigger measurement (CPU utilization, network traffic, disk activity, instance health) Trigger statistic Measurement period Breach duration Thresholds Breach scale increment Time-based scaling Name Min/Max instance Occurrence (One-time, Recurrent) Recurrence (CRON expression- 30 8 * * 3)
  58. 58. Other tips Logs, Metrics, & Alarms • Enable log rotation to automatically publish logs to S3. • Understand metrics available for your environment and what they mean. • Set up alarms to automatically monitor critical metrics and send notifications when metrics are outside normal operating range. • Enable Amazon Route 53 health checks and alarms 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
  59. 59. Key links Elastic beanstalk resources: http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/RelatedResources.html Sample application: https://github.com/awslabs/eb-node-express-sample Troubleshooting tips: http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/troubleshooting.html Tutorials and samples: http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/tutorials.html Deployment options: http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/using-features.deploy-existing-version.html Managed Updates: http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/environment-platform-update-managed.html http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/iam-servicerole.html#iam-servicerole-update Configuring Auto Scaling: http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/using-features.managing.as.html Load Testing with Locust: https://aws.amazon.com/blogs/devops/using-locust-on-aws-elastic-beanstalk-for-distributed-load-generation-and-testing/ https://github.com/awslabs/eb-locustio-sample Tagging your Elastic Beanstalk resources: http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/using-features.tagging.html
  60. 60. Key links- Custom Platforms • GitHub samples: https://github.com/awslabs/eb-custom-platforms-samples/tree/master • Custom Platform overview: http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/custom-platforms.html • EB CLI Commands – eb platform: http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb3-platform.html
  61. 61. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved Thanks You !

×