You are currently viewing Elastic Beanstalk Environment Customization With Configuration Files (.ebextensions)

Elastic Beanstalk Environment Customization With Configuration Files (.ebextensions)

Elastic Beanstalk environment customization with configuration files (.ebextensions)

Hello Everyone

Welcome to CloudAffaire and this is Debjeet.

In the last blog post, we have discussed Elastic Beanstalk monitoring.

https://cloudaffaire.com/elastic-beanstalk-monitoring/

In this blog post, we will discuss Elastic Beanstalk advanced environment customization with configuration files (.ebextensions).

. ebextensions:

You can add AWS Elastic Beanstalk configuration files (.ebextensions) to your web application’s source code to configure your environment and customize the AWS resources that it contains. Configuration files are YAML- or JSON-formatted documents with a .config file extension that you place in a folder named .ebextensions and deploy in your application source bundle. The option_settings section of a configuration file defines values for configuration options. Configuration options let you configure your Elastic Beanstalk environment, the AWS resources in it, and the software that runs your application.

Next, we are going to create a PHP web application using custom VPC and RDS instance configured using .config file placed in .ebextensions directory.

Prerequisite for this demo:

  • One EC2 AWS Linux 2 instance with proper access.

Step 1: Login to the EC2 instance and create your application root directory.

Step 2: Create .ebextentions directory and copy .config and .yml files.

Step 3: Create your custom VPC and get the resource ID’s.

Or you can directly copy resources ID’s from AWS CloudFormation console.

ebextensions

Next, we are going to edit the .config file under .ebextensions directory with resource ID’s

Step 4: Edit the .config file with vpc, subnets id’s.

ebextensions

Step 5: Create your application environment.

Cleanup:

Hope you have enjoyed this article. With this, we are concluding our introductory series on AWS Elastic Beanstalk. In the next blog post, we will start with a new AWS service.

To get more details on AWS Elastic Beanstalk, please refer below AWS documentation

https://docs.aws.amazon.com/elastic-beanstalk/index.html

 

This Post Has 2 Comments

  1. Avatar
    Pavan

    Hy not mapping the VPC id in ebextension config file

  2. Avatar
    Debjeet

    Dear Pavan,

    You have to provide the VPC id that you have created using CloudFormation.

    Thanks,
    Debjeet

Leave a Reply