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 to create a custom AMI because you do not need to maintain a set of AMIs.
You can use a configuration file for the following container types:
PHP 5.3, PHP 5.4, and PHP 5.5
Ruby 1.8.7, 1.9.3, 2.0.0, and 2.1.2
Apache Tomcat 6, 7, and 8
Windows Server 2008 R2 running IIS 7.5 and Windows Server 2012 running IIS 8 or IIS 8.5
Currently, Elastic Beanstalk does not support configuration files for the following legacy container types:
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.
You can include one or more configuration files with your source bundle. Configuration
files must be named with the extension .config (for example,
myapp.config) and placed in an
.ebextensions top-level directory in your source bundle.
Configuration files are executed in alphabetical order. For example,
.ebextensions/01run.config is executed before
Configuration files should conform to YAML or JSON formatting standards. For example, indentation is critical to the proper interpretation of YAML. For more information, go to http://www.yaml.org/start.html or http://www.json.org, respectively.
For Visual Studio,
.ebextensions needs to be part of the project
to be included in the archive. Alternatively, instead of including the configuration
files in the project, you can use Visual Studio to deploy all files in the project
To deploy all files in the project folder using Visual Studio
In Visual Studio, in Solution Explorer, right-click the project name, and then click Properties.
Click the Package/Publish Web tab.
In the Items to deploy section, select All Files in the Project Folder in the drop-down list.
When you are ready, deploy your application version. For more information, see Creating New Application Versions.
You can view the output of the steps executed during deployment by reviewing logs. For instructions on how to view logs, see Working with Logs. If any error occurs during the deployment process, Elastic Beanstalk does not deploy the new application version. Elastic Beanstalk will continue to run the last application version that you successfully deployed.
When customizing your Elastic Beanstalk environment, you can configure the software on your Amazon 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.