Unless you are deploying your Elastic Beanstalk application with a legacy container type, then you can use configuration files to customize and configure your environment. Configuration files are supported 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.
For more information about configuration files, see Customizing and Configuring Elastic Beanstalk Environments.
If you are deploying your Elastic Beanstalk application using a legacy container type, then you need to create a custom Amazon Machine Image (AMI) that Elastic Beanstalk uses for your applications. You can also use custom AMIs to improve the speed of deployments for which scaling activities specified in a configuration file result in a long installation process. To do this, customize the existing Elastic Beanstalk AMI. When you modify an Elastic Beanstalk AMI, do not replace components included in the solution stack. This section describes how to create and deploy a customized Amazon Machine Image (AMI) for use with Elastic Beanstalk.
To create and use a customized AMI
Open the Elastic Beanstalk console at https://console.aws.amazon.com/elasticbeanstalk/.
From the region list, select a region.
Launch your Elastic Beanstalk application. For more information on how to launch an Elastic Beanstalk application, go to the Getting Started Using Elastic Beanstalk.
Find the AMI ID used by Elastic Beanstalk to launch your application: Click the environment name, and then click Configuration in the navigation pane. Next to Instances, click . Copy the value in the Custom AMI ID box.
Use the Amazon EC2 console to launch an instance using that AMI ID:
You must use the Amazon EC2 console to launch an instance with the AMI ID. You cannot customize an instance that was launched by Elastic Beanstalk.
Open the Amazon EC2 console.
Click Launch Instance.
On the Choose an Amazon Machine Image (AMI) page, do one of the following:
Click the My AMIs tab to view private AMIs that you own or private AMIs that have been shared with you. Then, in the navigation pane, under Ownership, select the Owned by me check box and the Shared with me check box.
Click the Community AMIs tab to view AMIs provided by the AWS user community.
In the Search my AMIs or Search community AMIs text box, paste the AMI ID that Elastic Beanstalk used to launch your application and press Enter.
In the results list, click the Select button next to the AMI that you want to use to create your customized AMI.
On the Choose an Instance Type page, select the hardware configuration and size of the instance to launch. Larger instance types have more CPU and memory. For more information about instance families, see Instance Types in the Amazon Elastic Compute Cloud User Guide.
To stay within the free tier, select the t1.micro instance, and then click Next: Configure Instance Details.
On the Configure Instance Details page, click Advanced Details to expand the list of configuration options.
In the User data text box, type the following:
<repository version number>repo_upgrade: none
Specify the value of repo_releasever
according to the repository version number
for your container. For example, the
repository version number
the container with the name 32bit
Amazon Linux 2014.02 running Node.js is
more information about the AMI version number for your container
name, see the AMI column in Supported Platforms.
These settings configure the lock-on-launch feature, which causes the AMI to use a fixed, specific repository version when it launches, and disables the automatic installation of security updates. Both are required to use a custom AMI with Elastic Beanstalk.
Continue using the Amazon EC2 wizard to launch the Elastic Beanstalk AMI that you want to customize.
When launching the instance using the AWS Management Console, make sure that you create or specify a key pair and that you select your Amazon EC2 security group for your Elastic Beanstalk environment.
For additional information on how to launch an Amazon EC2 instance, go to Running an Instance in the Amazon Elastic Compute Cloud User Guide.
Connect to the instance. For more information on connecting to an Amazon EC2 instance, go to Connecting to Instances in the Amazon Elastic Compute Cloud User Guide.
After customizing a windows instance, you need to run the EC2Config service Sysprep. For information about EC2Config, go to Configuring a Windows Instance Using the EC2Config Service.
If you are using an AMI with Apache and Tomcat, you will need to perform your customizations.
Apache and Tomcat are not automatically started when you manually launch the Elastic Beanstalk AMI using the Amazon EC2 tab on the AWS Management Console. Enter the following commands at your Amazon EC2 instance's command prompt to start Apache and Tomcat.
sudo -s cd /etc/init.d ./httpd start ./tomcat7 start
From the Amazon EC2 console on the AWS Management Console, select the running instance that you've just modified and select Create Image (EBS AMI) from the Instance Actions menu. For more information on how to create an image from a running instance, go to Creating an Image from a Running Instance in the Amazon Elastic Compute Cloud User Guide. You can also view the Create Your Own Customized AMI video.
To avoid incurring additional AWS charges, terminate the Amazon EC2 instance you used to create the AMI. For instructions on how to terminate an instance, go to Terminate Your Instance in the Amazon Elastic Compute Cloud User Guide.
To use your custom AMI, specify your custom AMI ID in the Custom AMI ID text box in the Elastic Beanstalk Edit Configuration dialog box. Existing instances will be replaced with new instances launched from the new custom AMI.