"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."
Apidays New York 2024 - The value of a flexible API Management solution for O...
(APP201) Going Zero to Sixty with AWS Elastic Beanstalk | AWS re:Invent 2014
1. November 12, 2014 | Las Vegas, NV
APP201
Going Zero to Sixty with AWS Elastic
Beanstalk
Abhishek Singh, Product Manager, Amazon Web Services
2. 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.
6. Elastic Beanstalk object modelApplicationEnvironments
•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
7. 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)
8. On-instance configuration
Your code
HTTP server
Application server
Language interpreter
Operating system
Host
Focus on building your application
9. Application versions and saved configurations
Saved configurations
Save these for easy duplication for A/B testing or non-disruptive deployments
Application versions
All versions are stored durably in Amazon S3. Code can also be pushed from a Git repository!
11. 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
$gitaws.push
12. Deployment configuration
Region
01
Stack (container) type
02
Single instance
Load balanced with Auto Scaling
03
OR
Database (RDS)
04
Optional
Your code
13. 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)
14. Example: CLI workflow
$gitinit .
$ gitadd .
Initialize your Git repository
01
Add your code
04
$eb init
$gitcommit –m “v1.0”
Create your Elastic Beanstalk app
02
Commit
05
Follow the prompts to configure the environment
03
Create the resources and launch the application
06
$eb create
15. Example: CLI workflow
Update your code
01
$gitadd .
$ gitcommit –m “v2.0”
$ ebdeploy
Push the new code
02
Monitor the deployment progress
03
$eb status
17. Example: Deploy Docker container to EB
$gitinit .
Initialize your Git repository
01
$ gitadd Dockerfile
Add your code
04
$eb init
Create your Elastic Beanstalk app
02
$gitcommit –am “v1.0”
Commit
05
Follow the prompts to configure the environment and copy Dockerfile
03
06
Create the resources and launch the application
$eb create
21. 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::CacheCluster
Properties:
CacheNodeType:
Fn::GetOptionSetting:
OptionName : CacheNodeType
DefaultValue: cache.m1.small
NumCacheNodes:
Fn::GetOptionSetting:
OptionName : NumCacheNodes
DefaultValue: 1
Engine:
Fn::GetOptionSetting:
OptionName : Engine
DefaultValue: memcached
22. Zero-downtime deployments
Swap URLs
1.Create a new environmentfor 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
23. 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