AWS Elastic Beanstalk Developer Guide
User Manual:
Open the PDF directly: View PDF .
Page Count: 1150 [warning: Documents this large are best viewed by clicking the View PDF Link!]
- AWS Elastic Beanstalk
- Table of Contents
- What Is AWS Elastic Beanstalk?
- Getting Started Using Elastic Beanstalk
- AWS Elastic Beanstalk Concepts
- Service Roles, Instance Profiles, and User Policies
- Elastic Beanstalk Platforms
- Tutorials and Samples
- Managing and Configuring AWS Elastic Beanstalk Applications
- Managing Environments
- The AWS Elastic Beanstalk Environment Management Console
- Creating an AWS Elastic Beanstalk Environment
- The Create New Environment Wizard
- Clone an Environment
- Terminate an Environment
- Creating Elastic Beanstalk Environments with the AWS CLI
- Creating Elastic Beanstalk Environments with the API
- Constructing a Launch Now URL
- Creating and Updating Groups of AWS Elastic Beanstalk Environments
- Deploying Applications to AWS Elastic Beanstalk Environments
- Configuration Changes
- Updating Your Elastic Beanstalk Environment's Platform Version
- Canceling Environment Configuration Updates and Application Deployments
- Rebuilding AWS Elastic Beanstalk Environments
- Environment Types
- Worker Environments
- Creating Links Between AWS Elastic Beanstalk Environments
- AWS Elastic Beanstalk Environment Configuration
- Your AWS Elastic Beanstalk Environment's Auto Scaling Group
- Your AWS Elastic Beanstalk Environment's Load Balancer
- Adding a Database to Your Elastic Beanstalk Environment
- Environment Properties and Other Software Settings
- Configuring AWS X-Ray Debugging
- Elastic Beanstalk Environment Notifications with Amazon Simple Notification Service
- Streaming Logs to Amazon CloudWatch
- Configuring VPC with Elastic Beanstalk
- Your Elastic Beanstalk Environment's Domain Name
- Updating Tags in an Elastic Beanstalk Environment
- Advanced AWS Elastic Beanstalk Environment Configuration
- Configuration Options
- Precedence
- Recommended Values
- Setting Configuration Options Before Environment Creation
- Setting Configuration Options During Environment Creation
- Setting Configuration Options After Environment Creation
- General Options for All Environments
- aws:autoscaling:asg
- aws:autoscaling:launchconfiguration
- aws:autoscaling:scheduledaction
- aws:autoscaling:trigger
- aws:autoscaling:updatepolicy:rollingupdate
- aws:ec2:vpc
- aws:elasticbeanstalk:application
- aws:elasticbeanstalk:application:environment
- aws:elasticbeanstalk:cloudwatch:logs
- aws:elasticbeanstalk:command
- aws:elasticbeanstalk:environment
- aws:elasticbeanstalk:environment:process:default
- aws:elasticbeanstalk:environment:process:process_name
- aws:elasticbeanstalk:healthreporting:system
- aws:elasticbeanstalk:hostmanager
- aws:elasticbeanstalk:managedactions
- aws:elasticbeanstalk:managedactions:platformupdate
- aws:elasticbeanstalk:monitoring
- aws:elasticbeanstalk:sns:topics
- aws:elasticbeanstalk:sqsd
- aws:elb:healthcheck
- aws:elb:loadbalancer
- aws:elb:listener
- aws:elb:listener:listener_port
- aws:elb:policies
- aws:elb:policies:policy_name
- aws:elbv2:listener:default
- aws:elbv2:listener:listener_port
- aws:elbv2:listenerrule:rule_name
- aws:elbv2:loadbalancer
- aws:rds:dbinstance
- Platform Specific Options
- Custom Options
- Advanced Environment Customization with Configuration Files (.ebextensions)
- Option Settings
- Customizing Software on Linux Servers
- Customizing Software on Windows Servers
- Adding and Customizing Elastic Beanstalk Environment Resources
- Using Elastic Beanstalk Saved Configurations
- Environment Manifest (env.yaml)
- Creating a Custom Amazon Machine Image (AMI)
- Configuring HTTPS for your Elastic Beanstalk Environment
- Create and Sign an X509 Certificate
- Upload a Certificate to IAM
- Configuring Your Elastic Beanstalk Environment's Load Balancer to Terminate HTTPS
- Configuring Your Application to Terminate HTTPS Connections at the Instance
- Terminating HTTPS on EC2 Instances Running Docker
- Terminating HTTPS on EC2 Instances Running Go
- Terminating HTTPS on EC2 Instances Running Java SE
- Terminating HTTPS on EC2 Instances Running Node.js
- Terminating HTTPS on EC2 Instances Running PHP
- Terminating HTTPS on EC2 Instances Running Python
- Terminating HTTPS on EC2 Instances Running Ruby
- Terminating HTTPS on EC2 Instances Running Tomcat
- Terminating HTTPS on EC2 Instances Running .NET
- Configuring End-to-End Encryption in a Load Balanced Elastic Beanstalk Environment
- Configuring Your Environment's Load Balancer for TCP Passthrough
- Storing Private Keys Securely in Amazon S3
- Configuration Options
- Monitoring an Environment
- Monitoring Environment Health in the AWS Management Console
- Basic Health Reporting
- Enhanced Health Reporting and Monitoring
- The Elastic Beanstalk Health Agent
- Factors in Determining Instance and Environment Health
- Enhanced Health Roles
- Enhanced Health Events
- Enhanced Health Reporting Behavior During Updates, Deployments, and Scaling
- Enabling AWS Elastic Beanstalk Enhanced Health Reporting
- Enhanced Health Monitoring with the Environment Management Console
- Health Colors and Statuses
- Instance Metrics
- Publishing Amazon CloudWatch Custom Metrics for an Environment
- Using Enhanced Health Reporting with the AWS Elastic Beanstalk API
- Enhanced Health Log Format
- Notifications and Troubleshooting
- Manage Alarms
- Viewing an Elastic Beanstalk Environment's Event Stream
- Listing and Connecting to Server Instances
- Viewing Logs from Your Elastic Beanstalk Environment's Amazon EC2 Instances
- Using Elastic Beanstalk with Other AWS Services
- Architectural Overview
- Using Elastic Beanstalk with Amazon CloudFront
- Logging Elastic Beanstalk API Calls with AWS CloudTrail
- Using Elastic Beanstalk with Amazon CloudWatch
- Using Elastic Beanstalk with Amazon CloudWatch Logs
- Using Elastic Beanstalk with DynamoDB
- Using Elastic Beanstalk with Amazon ElastiCache
- Using Elastic Beanstalk with Amazon Elastic File System
- Using Elastic Beanstalk with AWS Identity and Access Management
- Managing Elastic Beanstalk Instance Profiles
- Managing Elastic Beanstalk Service Roles
- Verifying the Default Service Role's Permissions
- Updating an Out-of-Date Default Service Role
- Adding Permissions to the Default Service Role
- Creating a Service Role
- Using Service-Linked Roles for Elastic Beanstalk
- Controlling Access to Elastic Beanstalk
- Amazon Resource Name Format for Elastic Beanstalk
- Resources and Conditions for Elastic Beanstalk Actions
- Example Policies Based on Managed Policies
- Example Policies Based on Resource Permissions
- Using Elastic Beanstalk with Amazon Relational Database Service
- Using Elastic Beanstalk with Amazon Simple Storage Service
- Using Elastic Beanstalk with Amazon Virtual Private Cloud
- What VPC Configurations Do I Need?
- Example: Launching a Single-Instance Environment without Any Associated Private Resources in a VPC
- Example: Launching a Load-Balancing, Autoscaling Environment with Public and Private Resources in a VPC
- Example: Launching an Elastic Beanstalk Application in a VPC with Bastion Hosts
- Example: Launching an Elastic Beanstalk in a VPC with Amazon RDS
- Example: Launching a Load-Balancing, Autoscaling Environment with Public Instances in a VPC
- Configuring your development environment for use with AWS Elastic Beanstalk
- The Elastic Beanstalk Command Line Interface (EB CLI)
- Install the Elastic Beanstalk Command Line Interface (EB CLI)
- Configure the EB CLI
- Managing Elastic Beanstalk Environments with the EB CLI
- Using the EB CLI with AWS CodeBuild
- Using the EB CLI with Git
- Using the EB CLI with AWS CodeCommit
- Using the EB CLI to Monitor Environment Health
- Managing Multiple AWS Elastic Beanstalk Environments as a Group with the EB CLI
- Troubleshooting issues with the EB CLI
- EB CLI Command Reference
- EB CLI 2.6 (Deprecated)
- Elastic Beanstalk API Command Line Interface (deprecated)
- Converting Elastic Beanstalk API CLI Scripts
- Getting Set Up
- Common Options
- Operations
- elastic-beanstalk-check-dns-availability
- elastic-beanstalk-create-application
- elastic-beanstalk-create-application-version
- elastic-beanstalk-create-configuration-template
- elastic-beanstalk-create-environment
- elastic-beanstalk-create-storage-location
- elastic-beanstalk-delete-application
- elastic-beanstalk-delete-application-version
- elastic-beanstalk-delete-configuration-template
- elastic-beanstalk-delete-environment-configuration
- elastic-beanstalk-describe-application-versions
- elastic-beanstalk-describe-applications
- elastic-beanstalk-describe-configuration-options
- elastic-beanstalk-describe-configuration-settings
- elastic-beanstalk-describe-environment-resources
- elastic-beanstalk-describe-environments
- elastic-beanstalk-describe-events
- elastic-beanstalk-list-available-solution-stacks
- elastic-beanstalk-rebuild-environment
- elastic-beanstalk-request-environment-info
- elastic-beanstalk-restart-app-server
- elastic-beanstalk-retrieve-environment-info
- elastic-beanstalk-swap-environment-cnames
- elastic-beanstalk-terminate-environment
- elastic-beanstalk-update-application
- elastic-beanstalk-update-application-version
- elastic-beanstalk-update-configuration-template
- elastic-beanstalk-update-environment
- elastic-beanstalk-validate-configuration-settings
- Deploying Elastic Beanstalk Applications from Docker Containers
- Docker Platform Configurations
- Single Container Docker Environments
- Multicontainer Docker Environments
- Multicontainer Docker Platform
- Dockerrun.aws.json File
- Docker Images
- Container Instance Role
- Amazon ECS Resources Created by Elastic Beanstalk
- Using Multiple Elastic Load Balancing Listeners
- Failed Container Deployments
- Multicontainer Docker Configuration
- Multicontainer Docker Environments with the AWS Management Console
- Preconfigured Docker Containers
- Configuring Docker Environments
- Running a Docker Environment Locally with the EB CLI
- Deploying Go Applications to Elastic Beanstalk Applications
- Creating and Deploying Java Applications on AWS Elastic Beanstalk
- Getting Started with Java on Elastic Beanstalk
- Setting Up your Java Development Environment
- Using the AWS Elastic Beanstalk Tomcat Platform
- Using the AWS Elastic Beanstalk Java SE Platform
- Adding an Amazon RDS DB Instance to Your Java Application Environment
- Using the AWS Toolkit for Eclipse
- Importing Existing Environments into Eclipse
- Managing Elastic Beanstalk Application Environments
- Changing Environment Configuration Settings
- Changing Environment Type
- Configuring EC2 Server Instances Using AWS Toolkit for Eclipse
- Configuring Elastic Load Balancing Using AWS Toolkit for Eclipse
- Configuring Auto Scaling Using AWS Toolkit for Eclipse
- Configuring Notifications Using AWS Toolkit for Eclipse
- Configuring Java Containers Using AWS Toolkit for Eclipse
- Setting System Properties with AWS Toolkit for Eclipse
- Managing Multiple AWS Accounts
- Viewing Events
- Listing and Connecting to Server Instances
- Terminating an Environment
- Resources
- Creating and Deploying Elastic Beanstalk Applications in .NET Using AWS Toolkit for Visual Studio
- Getting Started with .NET on Elastic Beanstalk
- Setting Up your .NET Development Environment
- Using the AWS Elastic Beanstalk .NET Platform
- Tutorial: How to Deploy a .NET Sample Application Using AWS Elastic Beanstalk
- Deploying an ASP.NET Core Application with AWS Elastic Beanstalk
- Adding an Amazon RDS DB Instance to Your .NET Application Environment
- The AWS Toolkit for Visual Studio
- Test Locally
- Create an Elastic Beanstalk Environment
- Terminating an Environment
- Deploying to Your Environment
- Managing Your Elastic Beanstalk Application Environments
- Changing Environment Configurations Settings
- Configuring EC2 Server Instances Using the AWS Toolkit for Visual Studio
- Configuring Elastic Load Balancing Using the AWS Toolkit for Visual Studio
- Configuring Auto Scaling Using the AWS Toolkit for Visual Studio
- Configuring Notifications Using AWS Toolkit for Visual Studio
- Configuring .NET Containers Using the AWS Toolkit for Visual Studio
- Managing Accounts
- Listing and Connecting to Server Instances
- Monitoring Application Health
- Deploying Elastic Beanstalk Applications in .NET Using the Deployment Tool
- Resources
- Deploying Node.js Applications to AWS Elastic Beanstalk
- Getting Started with Node.js on Elastic Beanstalk
- Setting Up your Node.js Development Environment
- Using the AWS Elastic Beanstalk Node.js Platform
- Deploying an Express Application to Elastic Beanstalk
- Deploying a Node.js Application with DynamoDB to Elastic Beanstalk
- Deploying a Geddy Application with Clustering to Elastic Beanstalk
- Adding an Amazon RDS DB Instance to your Node.js Application Environment
- Resources
- Creating and Deploying PHP Applications on AWS Elastic Beanstalk
- Using the AWS Elastic Beanstalk PHP Platform
- Deploying a Laravel Application to Elastic Beanstalk
- Deploying a CakePHP Application to Elastic Beanstalk
- Deploying a Symfony2 Application to Elastic Beanstalk
- Deploying a High-Availability PHP Application with an External Amazon RDS Database to Elastic Beanstalk
- Deploying a High-Availability WordPress Website with an External Amazon RDS Database to Elastic Beanstalk
- Deploying a High-Availability Drupal Website with an External Amazon RDS Database to Elastic Beanstalk
- Adding an Amazon RDS DB Instance to Your PHP Application Environment
- Resources
- Working with Python
- Setting Up Your Python Development Environment
- Using the AWS Elastic Beanstalk Python Platform
- Deploying a Flask Application to AWS Elastic Beanstalk
- Deploying a Django Application to Elastic Beanstalk
- Adding an Amazon RDS DB Instance to Your Python Application Environment
- Python Tools and Resources
- Deploying Elastic Beanstalk Applications in Ruby Using EB CLI and Git
- Using the AWS Elastic Beanstalk Ruby Platform
- Deploying a Rails Application to Elastic Beanstalk
- Deploying a Sinatra Application to AWS Elastic Beanstalk
- Adding an Amazon RDS DB Instance to Your Ruby Application Environment
- Tools
- Resources
- Troubleshooting
- Elastic Beanstalk Resources
- Platform History
- Packer Platform History
- Single Container Docker Platform History
- Multicontainer Docker Platform History
- Docker Platform Earlier History
- Preconfigured Docker Platform History
- Go Platform History
- Tomcat Platform History
- Java SE Platform History
- .NET on Windows Server with IIS Platform History
- November 20, 2017 – December 18, 2017
- August 28, 2017 – November 19, 2017
- July 24, 2017 – Aug 27, 2017
- July 17, 2017 – July 23, 2017
- June 26, 2017 – July 16, 2017
- May 16, 2017 – July 16, 2017
- May 4, 2017 – May 15, 2017
- April 4, 2017 – May 3, 2017
- January 16, 2017 – Apr 3, 2017
- December 18, 2016 – January 15, 2017
- November 16, 2016 – December 18, 2016
- October 21, 2016 – November 16, 2016
- September 26, 2016 – October 21, 2016
- August 23, 2016 – September 26, 2016
- June 21, 2016 – August 23, 2016
- May 25, 2016 – June 21, 2016
- April 25, 2016 – May 25, 2016
- March 23, 2016 – April 25, 2016
- February 29, 2016 – March 23, 2016
- January 28, 2016 – February 29, 2016
- December 15, 2015 – January 28, 2016
- October 21, 2015 – December 15, 2015
- September 14, 2015 – October 21, 2015
- August 20, 2015 – September 14, 2015
- July 21, 2015 – August 20, 2015
- June 12, 2015 – July 21, 2015
- April 16, 2015 – June 12, 2015
- August 6, 2014 – April 16, 2015
- Prior to August 6, 2014
- Node.js Platform History
- PHP Platform History
- Python Platform History
- Ruby Platform History

AWS Elastic Beanstalk
Developer Guide
API Version 2010-12-01

AWS Elastic Beanstalk Developer Guide
AWS Elastic Beanstalk: Developer Guide
Copyright © 2018 Amazon Web Services, Inc. and/or its affiliates. All rights reserved.
Amazon's trademarks and trade dress may not be used in connection with any product or service that is not Amazon's, in any manner
that is likely to cause confusion among customers, or in any manner that disparages or discredits Amazon. All other trademarks not
owned by Amazon are the property of their respective owners, who may or may not be affiliated with, connected to, or sponsored by
Amazon.

AWS Elastic Beanstalk Developer Guide
Table of Contents
What Is AWS Elastic Beanstalk? ............................................................................................................ 1
Storage ..................................................................................................................................... 2
Pricing ...................................................................................................................................... 2
Community ............................................................................................................................... 2
Where to Go Next ...................................................................................................................... 2
Getting Started .................................................................................................................................. 3
Step 1: Sign up for the Service .................................................................................................... 3
Step 2: Create an Application ...................................................................................................... 3
Step 3: View Information About Your Environment ......................................................................... 6
Step 4: Deploy a New Application Version ..................................................................................... 7
Step 5: Change Configuration ...................................................................................................... 9
Step 6: Clean Up ...................................................................................................................... 10
Where to Go Next .................................................................................................................... 11
The EB CLI ...................................................................................................................... 11
AWS SDK for Java ............................................................................................................ 11
AWS Toolkit for Eclipse ..................................................................................................... 12
AWS SDK for .NET ............................................................................................................ 12
AWS Toolkit for Visual Studio ............................................................................................ 12
AWS SDK for Node.js ........................................................................................................ 12
AWS SDK for PHP ............................................................................................................ 12
Boto (AWS SDK for Python) ............................................................................................... 13
AWS SDK for Ruby ........................................................................................................... 13
Concepts ......................................................................................................................................... 14
Application .............................................................................................................................. 14
Application Version ................................................................................................................... 14
Environment ............................................................................................................................ 14
Environment Tier ...................................................................................................................... 14
Environment Configuration ........................................................................................................ 14
Configuration Template ............................................................................................................. 15
Web Server Environments ......................................................................................................... 15
Worker Environments ................................................................................................................ 16
Design Considerations ............................................................................................................... 17
Scalability ........................................................................................................................ 17
Security ........................................................................................................................... 18
Persistent Storage ............................................................................................................ 18
Fault Tolerance ................................................................................................................ 19
Content Delivery .............................................................................................................. 19
Software Updates and Patching ......................................................................................... 19
Connectivity ..................................................................................................................... 19
Permissions ..................................................................................................................................... 21
Service Role ............................................................................................................................. 21
Instance Profile ........................................................................................................................ 22
User Policy .............................................................................................................................. 24
Elastic Beanstalk Platforms ................................................................................................................ 26
Supported Platforms ................................................................................................................ 26
Packer Builder .................................................................................................................. 27
Single Container Docker .................................................................................................... 27
Multicontainer Docker ....................................................................................................... 27
Preconfigured Docker ........................................................................................................ 28
Go .................................................................................................................................. 29
Java SE ........................................................................................................................... 29
Java with Tomcat ............................................................................................................. 30
.NET on Windows Server with IIS ....................................................................................... 30
Node.js ............................................................................................................................ 32
API Version 2010-12-01
iii

AWS Elastic Beanstalk Developer Guide
PHP ................................................................................................................................ 33
Python ............................................................................................................................ 34
Ruby ............................................................................................................................... 34
Custom Platforms .................................................................................................................... 36
Creating a Custom Platform .............................................................................................. 37
Using a Sample Custom Platform ....................................................................................... 38
Platform Definition Archive Contents .................................................................................. 41
Platform Hooks ................................................................................................................ 42
Platform Scripts ............................................................................................................... 42
Packer Instance Cleanup .................................................................................................... 43
Platform.yaml Format ....................................................................................................... 43
Tutorials and Samples ....................................................................................................................... 47
Managing Applications ...................................................................................................................... 49
Application Management Console ............................................................................................... 49
Managing Application Versions ................................................................................................... 53
Version Lifecycle ...................................................................................................................... 56
Setting the Application Lifecycle Settings in the Console ....................................................... 57
Create a Source Bundle ............................................................................................................. 58
Creating a Source Bundle from the Command Line ............................................................... 58
Creating a Source Bundle with Git ...................................................................................... 59
Zipping Files in Mac OS X Finder or Windows Explorer .......................................................... 59
Creating a Source Bundle for a .NET Application ................................................................... 63
Testing Your Source Bundle ............................................................................................... 64
Managing Environments .................................................................................................................... 65
The Environment Management Console ...................................................................................... 65
Environment Dashboard .................................................................................................... 67
Environment Management Actions ..................................................................................... 68
Configuration ................................................................................................................... 70
Logs ............................................................................................................................... 71
Health ............................................................................................................................. 71
Monitoring ....................................................................................................................... 72
Alarms ............................................................................................................................ 73
Managed Updates ............................................................................................................ 74
Events ............................................................................................................................. 74
Tags ................................................................................................................................ 75
Creating Environments .............................................................................................................. 76
The Create New Environment Wizard .................................................................................. 78
Clone an Environment ..................................................................................................... 110
Terminate an Environment ............................................................................................... 114
With the AWS CLI ........................................................................................................... 116
With the API .................................................................................................................. 117
Launch Now URL ............................................................................................................ 119
Compose Environments ................................................................................................... 122
Deployments .......................................................................................................................... 124
Deployment Options ....................................................................................................... 125
Blue/Green Deployments ................................................................................................. 129
Deploying a New Application Version ................................................................................ 132
Redeploying a Previous Version ........................................................................................ 133
Configuration Changes ............................................................................................................ 133
Rolling Updates .............................................................................................................. 134
Immutable Updates ........................................................................................................ 138
Tag an Environment ........................................................................................................ 140
Platform Updates ................................................................................................................... 143
Managed Updates ........................................................................................................... 145
Upgrade a Legacy Environment ........................................................................................ 149
Cancel an Update ................................................................................................................... 151
Rebuild an Environment .......................................................................................................... 152
API Version 2010-12-01
iv

AWS Elastic Beanstalk Developer Guide
Rebuilding a Running Environment ................................................................................... 152
Rebuilding a Terminated Environment ............................................................................... 153
Environment Types ................................................................................................................. 154
Load-balancing, Autoscaling Environment .......................................................................... 154
Single-instance Environment ............................................................................................ 155
Changing Environment Type ............................................................................................ 155
Worker Environments .............................................................................................................. 156
The Worker Environment SQS Daemon ............................................................................. 158
Dead Letter Queues ........................................................................................................ 159
Periodic Tasks ................................................................................................................ 159
Use Amazon CloudWatch for Auto Scaling in Worker Environment Tiers ................................. 160
Configuring Worker Environments .................................................................................... 160
Environment Links .................................................................................................................. 162
Environment Configuration .............................................................................................................. 164
Auto Scaling Group ................................................................................................................. 165
Configuring Your Environment's Auto Scaling Group ........................................................... 165
The aws:autoscaling:asg Namespace ................................................................................. 167
EC2 Instances ................................................................................................................. 167
Triggers ......................................................................................................................... 170
Scheduled Actions .......................................................................................................... 172
Health Check Setting ...................................................................................................... 175
Load Balancer ........................................................................................................................ 176
Configuring a Classic Load Balancer .................................................................................. 176
Load Balancer Configuration Namespaces .......................................................................... 180
Application Load Balancer ............................................................................................... 181
Network Load Balancer ................................................................................................... 184
Configuring Access Logs .................................................................................................. 186
Database ............................................................................................................................... 186
Adding an Amazon RDS DB Instance to Your Environment ................................................... 187
Connecting to the database ............................................................................................. 188
Configuring an Integrated RDS DB Instance ....................................................................... 188
Software Settings ................................................................................................................... 189
Configuring Environment Properties ................................................................................. 190
Software Setting Namespaces .......................................................................................... 191
Accessing Environment Properties ..................................................................................... 192
Debugging ............................................................................................................................. 192
Configuring Debugging ................................................................................................... 194
The aws:elasticbeanstalk:xray Namespace .......................................................................... 194
Notifications .......................................................................................................................... 195
Configuring Notifications ................................................................................................. 195
The aws:elasticbeanstalk:sns:topics Namespace .................................................................. 196
Log Streaming ....................................................................................................................... 197
Configuring Log Streaming .............................................................................................. 197
The aws:elasticbeanstalk:cloudwatch:logs Namespace ......................................................... 198
VPC ...................................................................................................................................... 198
Domain Name ........................................................................................................................ 199
Updating tags ........................................................................................................................ 201
Advanced Configuration .................................................................................................................. 202
Configuration Options ............................................................................................................. 202
Precedence .................................................................................................................... 203
Recommended Values ..................................................................................................... 203
Before Environment Creation ........................................................................................... 205
During Creation .............................................................................................................. 209
After Creation ................................................................................................................ 213
General Options ............................................................................................................. 220
Platform Specific Options ................................................................................................ 248
Custom Options ............................................................................................................. 255
API Version 2010-12-01
v

AWS Elastic Beanstalk Developer Guide
.ebextensions ......................................................................................................................... 256
Option Settings .............................................................................................................. 257
Linux Server ................................................................................................................... 258
Windows Server ............................................................................................................. 269
Custom Resources ........................................................................................................... 275
Saved Configurations .............................................................................................................. 293
env.yaml ............................................................................................................................. 296
Custom Image ........................................................................................................................ 297
HTTPS ................................................................................................................................... 299
Create a Certificate ......................................................................................................... 300
Upload a Certificate ........................................................................................................ 302
Terminate at the Load Balancer ........................................................................................ 302
Terminate at the Instance ................................................................................................ 304
End-to-End Encryption .................................................................................................... 324
TCP Passthrough ............................................................................................................ 326
Store Keys Securely ........................................................................................................ 327
Monitoring an Environment ............................................................................................................. 329
Monitoring Console ................................................................................................................. 329
Overview ....................................................................................................................... 329
Monitoring Graphs .......................................................................................................... 330
Customizing the Monitoring Console ................................................................................. 331
Basic Health Reporting ............................................................................................................ 333
Health Colors ................................................................................................................. 333
Elastic Load Balancing Health Check ................................................................................. 334
Single Instance Environment Health Check ........................................................................ 334
Additional Checks ........................................................................................................... 334
Amazon CloudWatch Metrics ............................................................................................ 335
Enhanced Health Reporting and Monitoring ............................................................................... 336
The Elastic Beanstalk Health Agent ................................................................................... 337
Factors in Determining Instance and Environment Health .................................................... 338
Enhanced Health Roles .................................................................................................... 340
Enhanced Health Events .................................................................................................. 340
Enhanced Health Reporting Behavior During Updates, Deployments, and Scaling .................... 341
Enable Enhanced Health .................................................................................................. 341
Health Console ............................................................................................................... 344
Health Colors and Statuses .............................................................................................. 349
Instance Metrics ............................................................................................................. 351
CloudWatch ................................................................................................................... 352
API Users ....................................................................................................................... 357
Enhanced Health Log Format ........................................................................................... 359
Notifications and Troubleshooting .................................................................................... 361
Manage Alarms ...................................................................................................................... 362
View Events ........................................................................................................................... 365
Monitor Instances ................................................................................................................... 367
View Instance Logs ................................................................................................................. 369
Log Location on-Instance ................................................................................................ 371
Log Location in S3 ......................................................................................................... 371
Log Rotation Settings on Linux ........................................................................................ 372
Extending the Default Log Task Configuration .................................................................... 372
Amazon CloudWatch Logs ............................................................................................... 374
Integrating AWS Services ................................................................................................................. 376
Architectural Overview ............................................................................................................ 376
CloudFront ............................................................................................................................. 377
CloudTrail .............................................................................................................................. 377
Elastic Beanstalk Information in CloudTrail History ............................................................. 377
Elastic Beanstalk Information in CloudTrail Logging ............................................................ 377
Understanding Elastic Beanstalk Log File Entries ................................................................ 378
API Version 2010-12-01
vi

AWS Elastic Beanstalk Developer Guide
CloudWatch ........................................................................................................................... 379
CloudWatch Logs .................................................................................................................... 379
Streaming CloudWatch Logs ............................................................................................ 381
Setting Up CloudWatch Logs Integration with Configuration Files ......................................... 384
Troubleshooting CloudWatch Logs Integration ................................................................... 385
DynamoDB ............................................................................................................................. 386
ElastiCache ............................................................................................................................ 386
Amazon EFS ........................................................................................................................... 387
Configuration Files .......................................................................................................... 387
Encrypted File Systems ................................................................................................... 388
Sample Applications ....................................................................................................... 388
IAM ....................................................................................................................................... 388
Instance Profiles ............................................................................................................. 388
Service Roles .................................................................................................................. 393
User Policies .................................................................................................................. 403
ARN Format ................................................................................................................... 407
Resources and Conditions ................................................................................................ 408
Example Policies ............................................................................................................. 430
Example Policies Based on Resource Permissions ................................................................ 432
Amazon RDS .......................................................................................................................... 439
Launching and Connecting to an External RDS Instance in a Default VPC ................................ 440
Launching and Connecting to an External RDS Instance in EC2 Classic ................................... 444
Storing the Connection String in Amazon S3 ..................................................................... 449
Amazon S3 ............................................................................................................................ 451
Amazon VPC .......................................................................................................................... 451
What VPC Configurations Do I Need? ................................................................................ 452
Single-Instance Environment in a VPC ............................................................................... 453
Load-Balancing Environment with Private Instances ............................................................ 458
Bastion Hosts ................................................................................................................. 462
Amazon RDS .................................................................................................................. 466
Load-Balancing Environment with Public Instances ............................................................. 472
Your Local Development Environment ............................................................................................... 477
Creating a Project Folder ......................................................................................................... 477
Setting Up Source Control ....................................................................................................... 477
Configuring a Remote Repository ............................................................................................. 478
Installing the EB CLI ............................................................................................................... 478
Installing the AWS CLI ............................................................................................................. 478
The EB CLI ..................................................................................................................................... 480
Install the EB CLI .................................................................................................................... 481
Linux ............................................................................................................................. 482
Windows ....................................................................................................................... 485
macOS .......................................................................................................................... 486
Virtualenv ...................................................................................................................... 488
Configure the EB CLI ............................................................................................................... 489
Ignoring files with .ebignore ............................................................................................ 491
Using Named Profiles ...................................................................................................... 491
Deploying an Artifact Instead of the Project Folder ............................................................. 491
Configuration Settings and Precedence ............................................................................. 492
Instance Metadata .......................................................................................................... 492
EB CLI Basics .......................................................................................................................... 492
eb create ....................................................................................................................... 493
eb status ....................................................................................................................... 493
eb health ....................................................................................................................... 494
eb events ...................................................................................................................... 494
eb logs .......................................................................................................................... 495
eb open ........................................................................................................................ 495
eb deploy ...................................................................................................................... 495
API Version 2010-12-01
vii

AWS Elastic Beanstalk Developer Guide
eb config ....................................................................................................................... 496
eb terminate .................................................................................................................. 496
AWS CodeBuild ...................................................................................................................... 497
Creating an Application ................................................................................................... 497
Using the EB CLI with Git ........................................................................................................ 497
Associating Elastic Beanstalk environments with Git branches .............................................. 497
Deploying changes .......................................................................................................... 498
Using Git submodules ..................................................................................................... 498
Assigning Git tags to your application version .................................................................... 499
AWS CodeCommit .................................................................................................................. 499
Prerequisites .................................................................................................................. 499
Creating an AWS CodeCommit Repository with the EB CLI ................................................... 500
Deploying from Your AWS CodeCommit Repository ............................................................ 500
Configuring Additional Branches and Environments ............................................................ 501
Using an Existing AWS CodeCommit Repository ................................................................. 502
Monitoring Health .................................................................................................................. 503
Reading the Output ........................................................................................................ 505
Interactive Health View ................................................................................................... 506
Interactive Health View Options ....................................................................................... 507
Composing Environments ........................................................................................................ 508
Troubleshooting ..................................................................................................................... 509
Troubleshooting deployments .......................................................................................... 509
EB CLI Commands .................................................................................................................. 511
eb abort ..................................................................................................................... 512
eb appversion ........................................................................................................... 513
eb clone ..................................................................................................................... 515
eb codesource ........................................................................................................... 517
eb config ................................................................................................................... 518
eb console ................................................................................................................. 520
eb create ................................................................................................................... 521
eb deploy ................................................................................................................... 527
eb events ................................................................................................................... 529
eb health ................................................................................................................... 530
eb init ...................................................................................................................... 532
eb labs ...................................................................................................................... 534
eb list ...................................................................................................................... 535
eb local ..................................................................................................................... 536
eb logs ...................................................................................................................... 538
eb open ...................................................................................................................... 539
eb platform ............................................................................................................... 540
eb printenv ............................................................................................................... 546
eb restore ................................................................................................................. 547
eb scale ..................................................................................................................... 548
eb setenv ................................................................................................................... 548
eb ssh ........................................................................................................................ 549
eb status ................................................................................................................... 551
eb swap ...................................................................................................................... 552
eb tags ...................................................................................................................... 553
eb terminate ............................................................................................................. 555
eb upgrade ................................................................................................................. 556
eb use ........................................................................................................................ 557
Common Options ........................................................................................................... 558
EB CLI 2.6 (Deprecated) ........................................................................................................... 558
Differences from Version 3 of EB CLI ................................................................................. 559
Migrating to EB CLI 3 and AWS CodeCommit ..................................................................... 559
Getting Started with Eb .................................................................................................. 560
Deploying a Branch to an Environment ............................................................................. 565
API Version 2010-12-01
viii

AWS Elastic Beanstalk Developer Guide
Eb Common Options ....................................................................................................... 567
EB CLI 2 Commands ....................................................................................................... 567
EB API CLI (deprecated) ........................................................................................................... 585
Converting Elastic Beanstalk API CLI Scripts ....................................................................... 585
Getting Set Up ............................................................................................................... 587
Common Options ........................................................................................................... 589
Operations ..................................................................................................................... 590
Working with Docker ...................................................................................................................... 632
Docker Platform Configurations ............................................................................................... 632
Single Container Docker .................................................................................................. 632
Multicontainer Docker ..................................................................................................... 632
Preconfigured Docker Containers ...................................................................................... 633
Single Container Docker .......................................................................................................... 633
Sample PHP Application .................................................................................................. 634
Sample Python Application .............................................................................................. 634
Sample Dockerfile Application .......................................................................................... 634
Single Container Docker Configuration .............................................................................. 634
Multicontainer Docker ............................................................................................................. 638
Multicontainer Docker Platform ........................................................................................ 639
Dockerrun.aws.json File ................................................................................................... 639
Docker Images ............................................................................................................... 640
Container Instance Role ................................................................................................... 640
Amazon ECS Resources Created by Elastic Beanstalk ........................................................... 641
Using Multiple Elastic Load Balancing Listeners .................................................................. 641
Failed Container Deployments .......................................................................................... 642
Multicontainer Docker Configuration ................................................................................. 642
Tutorial - Multicontainer Docker ....................................................................................... 646
Preconfigured Containers ......................................................................................................... 652
Getting Started with Preconfigured Docker Containers ........................................................ 652
Example: Customize and Configure Preconfigured Docker Platforms ...................................... 654
Environment Configuration ...................................................................................................... 655
Docker Images ............................................................................................................... 656
Configuring Additional Storage Volumes ........................................................................... 658
Reclaiming Docker Storage Space ..................................................................................... 659
Running Containers Locally ...................................................................................................... 659
Prerequisites for Running Docker Applications Locally ......................................................... 659
Preparing a Docker Application for Use with the EB CLI ....................................................... 660
Running a Docker Application Locally ................................................................................ 660
Cleaning Up After Running a Docker Application Locally ...................................................... 662
Working with Go ............................................................................................................................ 664
The Go Platform .................................................................................................................... 664
Configuring Your Go Environment .................................................................................... 665
The aws:elasticbeanstalk:container:golang:staticfiles Namespace ........................................... 665
Procfile .......................................................................................................................... 666
Buildfile ......................................................................................................................... 667
Proxy Configuration ........................................................................................................ 667
The Docker-based Go Platform ................................................................................................ 668
Set Up Your Local Development Environment .................................................................... 668
Develop and Test Locally Using Docker ............................................................................. 668
Deploy to Elastic Beanstalk .............................................................................................. 669
Working with Java .......................................................................................................................... 671
Getting Started ...................................................................................................................... 671
Launching an Environment with a Sample Java Application .................................................. 672
Next Steps ..................................................................................................................... 676
Development Environment ...................................................................................................... 676
Installing the Java Development Kit .................................................................................. 677
Installing a Web Container ............................................................................................... 677
API Version 2010-12-01
ix

AWS Elastic Beanstalk Developer Guide
Downloading Libraries ..................................................................................................... 677
Installing the AWS SDK for Java ....................................................................................... 677
Installing an IDE or Text Editor ......................................................................................... 677
Installing the AWS Toolkit for Eclipse ................................................................................ 678
The Tomcat Platform .............................................................................................................. 678
Configuring Your Tomcat Environment .............................................................................. 678
Tomcat Configuration Namespaces ................................................................................... 680
Bundling WAR Files ......................................................................................................... 681
Structuring your Project Folder ........................................................................................ 681
Proxy Configuration ........................................................................................................ 684
The Java SE Platform .............................................................................................................. 686
Configuring Your Java SE Environment .............................................................................. 687
The aws:elasticbeanstalk:container:java:staticfiles Namespace ............................................... 687
Procfile .......................................................................................................................... 688
Buildfile ......................................................................................................................... 689
Proxy Configuration ........................................................................................................ 689
Adding a Database ................................................................................................................. 690
Downloading the JDBC Driver .......................................................................................... 691
Connecting to a Database (Java SE Platforms) .................................................................... 692
Connecting to a Database (Tomcat Platforms) .................................................................... 692
Troubleshooting Database Connections ............................................................................. 694
Eclipse Toolkit ........................................................................................................................ 696
Importing Existing Environments into Eclipse ..................................................................... 696
Managing Environments .................................................................................................. 696
Managing Multiple AWS Accounts ..................................................................................... 706
Viewing Events ............................................................................................................... 707
Listing and Connecting to Server Instances ........................................................................ 708
Terminating an Environment ............................................................................................ 709
Resources .............................................................................................................................. 709
Working with .NET .......................................................................................................................... 710
Getting Started ...................................................................................................................... 710
Launching an Environment with a Sample .NET Application .................................................. 711
Next Steps ..................................................................................................................... 713
Development Environment ...................................................................................................... 713
Installing an IDE ............................................................................................................. 713
Installing the AWS Toolkit for Visual Studio ....................................................................... 713
The .NET Platform .................................................................................................................. 713
Configuring your .NET Environment in the AWS Management Console ................................... 714
The aws:elasticbeanstalk:container:dotnet:apppool Namespace ............................................. 715
Migrating to v1 Elastic Beanstalk Windows Server Platforms ................................................ 715
Deployment Manifest ...................................................................................................... 716
Tutorial - ASP.NET MVC5 ......................................................................................................... 720
Create the Environment .................................................................................................. 720
Publish Your Application to Elastic Beanstalk ..................................................................... 726
Clean Up Your AWS Resources ......................................................................................... 733
Tutorial - .NET Core ................................................................................................................ 734
Prerequisites .................................................................................................................. 734
Generate a .NET Core Project ........................................................................................... 735
Launch an Elastic Beanstalk Environment .......................................................................... 736
Update the Source Code .................................................................................................. 736
Deploy Your Application .................................................................................................. 739
Clean Up ....................................................................................................................... 741
Next Steps ..................................................................................................................... 741
Adding a Database ................................................................................................................. 742
Adding a DB Instance to Your Environment ........................................................................ 742
Downloading a Driver ..................................................................................................... 743
Connecting to a Database ............................................................................................... 743
API Version 2010-12-01
x

AWS Elastic Beanstalk Developer Guide
The AWS Toolkit for Visual Studio ............................................................................................ 744
Test Locally .................................................................................................................... 745
Create an Elastic Beanstalk Environment ........................................................................... 745
Terminating an Environment ............................................................................................ 754
Deploy .......................................................................................................................... 754
Managing Environments .................................................................................................. 757
Managing Accounts ......................................................................................................... 766
Debug ........................................................................................................................... 767
Monitor ......................................................................................................................... 768
Deployment Tool ............................................................................................................ 769
Resources .............................................................................................................................. 770
Working with Node.js ...................................................................................................................... 772
Getting Started ...................................................................................................................... 772
Launching an Environment with a Sample Node.js Application .............................................. 772
Next Steps ..................................................................................................................... 775
Development Environment ...................................................................................................... 775
Installing Node.js ............................................................................................................ 775
Installing npm ................................................................................................................ 775
Installing the AWS SDK for Node.js ................................................................................... 776
Installing Express ............................................................................................................ 776
Installing Geddy ............................................................................................................. 776
The Node.js Platform .............................................................................................................. 777
Configuring Your Node.js Environment .............................................................................. 778
Node.js Configuration Namespaces ................................................................................... 779
Installing Packages with a Package.json File ....................................................................... 779
Locking Dependencies with npm shrinkwrap ...................................................................... 780
Configuring the Proxy Server ........................................................................................... 780
Tutorial - Express .................................................................................................................... 782
Prerequisites .................................................................................................................. 782
Install Express and Generate a Project ............................................................................... 782
Create an Elastic Beanstalk Environment ........................................................................... 783
Update the Application ................................................................................................... 784
Clean Up ....................................................................................................................... 786
Tutorial - Node.js w/ DynamoDB .............................................................................................. 786
Prerequisites .................................................................................................................. 787
Launch an Elastic Beanstalk Environment .......................................................................... 787
Add Permissions to Your Environment's Instances ............................................................... 788
Deploy the Sample Application ........................................................................................ 789
Create a DynamoDB Table ............................................................................................... 791
Update the Application's Configuration Files ...................................................................... 791
Configure Your Environment for High Availability ............................................................... 794
Clean Up ....................................................................................................................... 794
Next Steps ..................................................................................................................... 795
Tutorial - Geddy with Clustering ............................................................................................... 795
Step 1: Set Up Your Git Repository ................................................................................... 795
Step 2: Set Up Your Geddy Development Environment ........................................................ 795
Step 3: Configure Elastic Beanstalk ................................................................................... 796
Step 5: View the Application ............................................................................................ 798
Step 6: Update the Application ........................................................................................ 798
Step 7: Clean Up ............................................................................................................ 805
Adding a Database ................................................................................................................. 805
Adding a DB Instance to Your Environment ........................................................................ 805
Downloading a Driver ..................................................................................................... 806
Connecting to a Database ............................................................................................... 807
Resources .............................................................................................................................. 807
Working with PHP .......................................................................................................................... 808
The PHP Platform .................................................................................................................. 808
API Version 2010-12-01
xi

AWS Elastic Beanstalk Developer Guide
Configuring your PHP Environment ................................................................................... 809
The aws:elasticbeanstalk:container:php:phpini Namespace ................................................... 810
Composer File ................................................................................................................ 810
Update Composer ........................................................................................................... 811
Extending php.ini ........................................................................................................... 811
Tutorial - Laravel 5.2 .............................................................................................................. 811
Prerequisites .................................................................................................................. 812
Install Composer ............................................................................................................ 812
Install Laravel and Generate a Website .............................................................................. 813
Create an Elastic Beanstalk Environment and Deploy Your Application ................................... 813
Add a Database to Your Environment ................................................................................ 815
Clean Up ....................................................................................................................... 817
Next Steps ..................................................................................................................... 818
Tutorial - CakePHP 3.2 ............................................................................................................ 818
Prerequisites .................................................................................................................. 819
Install Composer ............................................................................................................ 819
Install CakePHP and Generate a Website ........................................................................... 820
Create an Elastic Beanstalk Environment and Deploy Your Application ................................... 820
Add a Database to Your Environment ................................................................................ 823
Clean Up ....................................................................................................................... 824
Next Steps ..................................................................................................................... 825
Tutorial - Symfony2 ................................................................................................................ 825
Set Up Your Symfony2 Development Environment .............................................................. 826
Configure Elastic Beanstalk .............................................................................................. 827
View the Application ....................................................................................................... 828
Update the Application ................................................................................................... 829
Clean Up ....................................................................................................................... 829
Tutorial - HA Production ......................................................................................................... 829
Prerequisites .................................................................................................................. 830
Launch a DB Instance in Amazon RDS ............................................................................... 830
Launch an Elastic Beanstalk Environment .......................................................................... 832
Configure Security Groups, Environment Properties, and Scaling ........................................... 833
Deploy the Sample Application ........................................................................................ 834
Clean Up ....................................................................................................................... 836
Next Steps ..................................................................................................................... 837
Tutorial - HA WordPress .......................................................................................................... 837
Launch a DB Instance in Amazon RDS ............................................................................... 838
Download WordPress ...................................................................................................... 840
Launch an Elastic Beanstalk Environment .......................................................................... 841
Configure Security Groups and Environment Properties ....................................................... 842
Install WordPress ............................................................................................................ 843
Updating keys and salts .................................................................................................. 843
Update the Environment ................................................................................................. 844
Configure Autoscaling ..................................................................................................... 845
Review .......................................................................................................................... 845
Clean Up ....................................................................................................................... 846
Next Steps ..................................................................................................................... 846
Tutorial - HA Drupal ............................................................................................................... 847
Launch a DB Instance in Amazon RDS ............................................................................... 847
Download Drupal ............................................................................................................ 850
Launch an Elastic Beanstalk Environment .......................................................................... 851
Configure Security Groups and Environment Properties ....................................................... 851
Install Drupal ................................................................................................................. 853
Update the Environment ................................................................................................. 854
Configure Autoscaling ..................................................................................................... 854
Review .......................................................................................................................... 855
Clean Up ....................................................................................................................... 855
API Version 2010-12-01
xii

AWS Elastic Beanstalk Developer Guide
Next Steps ..................................................................................................................... 856
Adding a Database ................................................................................................................. 856
Adding a DB Instance to Your Environment ........................................................................ 857
Downloading a Driver ..................................................................................................... 858
Connecting to a Database with a PDO or MySQLi ............................................................... 858
Resources .............................................................................................................................. 859
Working with Python ...................................................................................................................... 860
Development Environment ...................................................................................................... 860
Common Prerequisites .................................................................................................... 860
Setting up a virtual Python environment ........................................................................... 861
Configuring a Python project for Elastic Beanstalk .............................................................. 861
The Python Platform .............................................................................................................. 862
Configuring Your Python Environment .............................................................................. 862
Python Configuration Namespaces .................................................................................... 863
Requirements File ........................................................................................................... 864
Tutorial - Flask 0.10 ................................................................................................................ 865
Prerequisites .................................................................................................................. 865
Set Up a Python Virtual Environment with Flask ................................................................. 865
Create a Flask Application ............................................................................................... 866
Configure Your Flask Application for Elastic Beanstalk ......................................................... 868
Deploy Your Site With the EB CLI ..................................................................................... 868
Clean Up and Next Steps ................................................................................................. 870
Tutorial - Django 1.9 ............................................................................................................... 870
Prerequisites .................................................................................................................. 871
Set Up a Python Virtual Environment with Django .............................................................. 871
Create a Django Project ................................................................................................... 872
Configure Your Django Application for Elastic Beanstalk ...................................................... 874
Deploy Your Site With the EB CLI ..................................................................................... 875
Updating Your Application ............................................................................................... 877
Clean Up and Next Steps ................................................................................................. 880
Adding a Database ................................................................................................................. 881
Adding a DB Instance to Your Environment ........................................................................ 881
Downloading a Driver ..................................................................................................... 882
Connecting to a Database ............................................................................................... 883
Tools and Resources ................................................................................................................ 883
Working with Ruby ......................................................................................................................... 884
The Ruby Platform ................................................................................................................. 884
Configuring Your Ruby Environment ................................................................................. 885
Ruby Configuration Namespaces ....................................................................................... 886
Installing Packages with a Gemfile .................................................................................... 886
Tutorial - Rails 4.1 .................................................................................................................. 886
Rails Development Environment Setup .............................................................................. 887
Install the EB CLI ............................................................................................................ 888
Set Up Your Git Repository .............................................................................................. 889
Configure the EB CLI ....................................................................................................... 889
Create a Service Role and Instance Profile ......................................................................... 890
Update the Gemfile ........................................................................................................ 890
Deploy the Project .......................................................................................................... 890
Update the Application ................................................................................................... 893
Clean Up ....................................................................................................................... 894
Tutorial - Sinatra .................................................................................................................... 894
Prerequisites .................................................................................................................. 894
Step 1: Set Up Your Project ............................................................................................. 895
Step 2: Create an Application ........................................................................................... 896
Step 3: Create an Environment ......................................................................................... 897
Step 4: Deploy a Simple Sinatra Application