AWS Elastic Beanstalk
Developer Guide (API Version 2010-12-01)
« PreviousNext »
View the PDF for this guide.Go to the AWS Discussion Forum for this product.Go to the Kindle Store to download this guide in Kindle format.Did this page help you?  Yes | No |  Tell us about it...

Customizing and Configuring AWS Elastic Beanstalk Environments

When deploying your applications, you may want to customize and configure the software that your application depends on. These files could be either dependencies required by the application—for example, additional packages from the yum repository—or they could be configuration files such as a replacement for httpd.conf to override specific settings that are defaulted by AWS Elastic Beanstalk. You may also want to customize your environment resources that are part of your AWS Elastic Beanstalk environment (e.g., SQS queues, ElastiCache clusters). For example, you may want to add an Amazon SQS queue and an alarm on queue depth, or you might want to add an Amazon ElastiCache cluster.

You can easily customize your environment at the same time that you deploy your application version by including a configuration file with your source bundle. When customizing the software on your instance, it is more advantageous to use a configuration file than customizing your own AMI because you do not need to maintain a set of AMIs.

Supported Container Types

You can use a configuration file for the following container non-legacy container types:

  • Node.js

  • PHP 5.3, PHP 5.4, and PHP 5.5

  • Python

  • Ruby 1.8.7, 1.9.3, and 2.0.0

  • Apache Tomcat 6 and 7

  • Windows Server 2008 R2 running IIS 7.5 and Windows Server 2012 running IIS 8

Currently, AWS Elastic Beanstalk does not support configuration files for the following legacy container types:

  • PHP 5.3

  • Tomcat 6 and 7

  • Windows Server 2008 R2 running IIS 7.5 and Windows Server 2012 running IIS 8

If you are unsure if you are running a legacy container, check the Elastic Beanstalk console. For instructions, see To check if you are using a legacy container type.

Using Configuration Files

Customizing your AWS Elastic Beanstalk environment when you deploy your application requires two steps:

  1. Create a configuration file with the extension .config (e.g., myapp.config) and place it in an .ebextensions top-level directory of your source bundle. You can have multiple configuration files in your .ebextensions directory. These files are executed in alphabetical order. For example, .ebextensions/01run.config is executed before .ebextensions/02do.config.

    Note

    Configuration files should conform to YAML or JSON formatting standards. For more information, go to http://www.yaml.org/start.html or http://www.json.org. respectively.

    Note

    For Visual Studio, .ebextensions needs to be part of the project to be included in the archive. Alternatively, in the Package/Publish Web settings, in the Items to deploy section, you can select All Files in the Project Folder.

  2. Deploy your application version.

    Note

    You can take a snapshot of the logs to view the output of the steps during deployment. For instructions on how to view the logs, see Working with Logs. If any error occurs during the deployment process, AWS Elastic Beanstalk does not deploy the new application version. If you deployed an older application version, you will continue to see it running.

When customizing your AWS Elastic Beanstalk environment, you can configure the software on your EC2 instances as well as the AWS resources in your environment. This section is split into the following parts:

Each section describes the supported configuration settings and their syntax, as well as provides examples.