We are excited to continue our work on BeanStalk with the introduction of a range of great new features. If you are a Python shop you'll learn how BeanStalk now supports Python containers and the Django and Flask frameworks. Hear about BeanStalk integration with RDS and how custom configuration of containers is possible through simple configuration files.
32. Add “.ebextensions” directory
Add “.config” file
# Configure third-party service credentials
# Run rake tasks before an application deployment
container_commands:
01deploy:
command: rake my_deployment_tasks
# in environment variables:
option_settings:
- option_name: AIRBRAKE_API_KEY
value: MYAPIKEY
33. RDS populated from rails model
# Configure third-party service credentials
# Run rake tasks before an application deployment
container_commands:
01deploy:
command: rake my_deployment_tasks
# in environment variables:
option_settings:
- option_name: AIRBRAKE_API_KEY
value: MYAPIKEY
36. .ebextensions
Java, Python & Ruby container configuration
packages
Download and install pre-packaged applications and components using apt, yum,
rubygems, python, and rpm
sources
Download an archive file and unpack it in a target directory on the EC2 instance
(e.g from S3). Supported formats are tar, tar+gzip, tar+bz2 and zip
files
Create files on the EC2 instance
Users/groups
Create Linux/UNIX users/groups on the EC2 instance
37. .ebextensions
Java, Python & Ruby container configuration
packages packages:
Download and install pre-packagedyum:
applications and components using apt, yum,
rubygems, python, and rpm package1: [3.2.1]
sources package2: [1.0]
rpm:
Download an archive file and unpack it in a target directory on the EC2 instance
package3
(e.g from S3). Supported formats are tar, tar+gzip, tar+bz2 and zip
files
Create files on the EC2 instance
Users/groups
Create Linux/UNIX users/groups on the EC2 instance
38. .ebextensions
Java, Python & Ruby container configuration
packages
Download and install pre-packaged applications and components using apt, yum,
rubygems, python, and rpm
sources:
sources /home/myfiles:
https://s3.amazonaws.com/bucket/myf
Download an archive file and unpack it in a target directory on the EC2 instance
iles.zip
(e.g from S3). Supported formats are tar, tar+gzip, tar+bz2 and zip
files
Create files on the EC2 instance
Users/groups
Create Linux/UNIX users/groups on the EC2 instance
39. .ebextensions
Java, Python & Ruby container configuration
packages files:
Download and install pre-packaged“/home/ec2-user/myfile” :
applications and components using apt, yum,
mode: "000777"
rubygems, python, and rpm owner: ec2-user
group: ec2-user
sources source: http://foo.bar/myfile
Download an archive file and unpack it in a target directory on the EC2 instance
“/home/ec2-user/myfile2” :
(e.g from S3). Supported formats are tar, tar+gzip, tar+bz2 and zip
mode: “000777”
owner: ec2-user
files group: ec2-user
Create files on the EC2 instance content: |
# this is my file
# with content
Users/groups
Create Linux/UNIX users/groups on the EC2 instance
40. .ebextensions
Java, Python & Ruby container configuration
packages users:
Download and install pre-packaged - myuser : and components using apt, yum,
applications
rubygems, python, and rpm groups:
- group1
sources - group2
uid: 50
Download an archive file and unpack it in a target directory on the EC2 instance
(e.g from S3). Supported formats are tar,homedir: tar+bz2 and zip
tar+gzip, “/tmp”
files groups:
- group1 : 45
Create files on the EC2 instance - group2 : 99
- group3
Users/groups
Create Linux/UNIX users/groups on the EC2 instance
41. .ebextensions
Java, Python & Ruby container configuration
command
Execute commands on the EC2 instance
container_commands
Execute commands for your container
services
Define which services should be started or stopped when the instance is launched
including dependencies that require Beanstalk to execute a restart
option_settings
Define container settings that get passed in as environment variables on your
Amazon EC2 instances
42. .ebextensions
Java, Python & Ruby container configuration
command commands:
Execute commands on the EC2 instance
myscript:
container_commands command: myscript.py
cwd: /home/ec2-user
Execute commands for your container
env:
services a: b
Define which services should be started or stopped when the instance is launched
including dependencies that require Beanstalk to execute a restart
option_settings
Define container settings that get passed in as environment variables on your
Amazon EC2 instances
43. .ebextensions
Java, Python & Ruby container configuration
command
Execute commands on the EC2 instance
container_commands:
container_commands replace-config-label:
Execute commands for your containercommand: cp
.ebextensions/server.xml
services /etc/tomcat7/server.xml
Define which services should be started or stopped when the instance is launched
including dependencies that require Beanstalk to execute a restart
option_settings
Define container settings that get passed in as environment variables on your
Amazon EC2 instances
44. .ebextensions
Java, Python & Ruby container configuration
command
Execute commands on the EC2 instance
container_commands
services:
Execute commands for your container
sysvinit:
services - myservice:
Define which services should be started or stopped when the instance is launched
enabled: true
including dependencies that require Beanstalk to execute a restart
ensureRunning: true
option_settings
Define container settings that get passed in as environment variables on your
Amazon EC2 instances
45. .ebextensions
Java, Python & Ruby container configuration
command option_settings:
Execute commands on the EC2 instance - namespace:
aws:elasticbeanstalk:container:tom
container_commands cat:jvmoptions
Execute commands for your container option_name: Xmx
value: 256m
services - option_name: AWS_SECRET_KEY
Define which services should be started or stopped when the instance is launched
value:
including dependencies that require Beanstalk to execute a restart
wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAM
option_settings PLEKEY
- option_name: AWS_ACCESS_KEY_ID
Define container settings that get passed in as environment variables on your
value: AKIAIOSFODNN7EXAMPLE
Amazon EC2 instances
47. Elastic Bean Stalk
Deploy apps inside a Virtual Private Cloud
Launch apps into a VPC
Launch “private” Deeper networking
applications control
48. Elastic Bean Stalk
Additional required options
VPCId
Contains the ID of the VPC
Subnets
Contains the ID of the Auto Scaling group subnet
ELBSubnets
Contains the ID of the subnet for the elastic load
balancer
SecurityGroups
Contains the ID of the security group.