You are currently viewing Elastic Beanstalk Command Line Interface (EB CLI)

Elastic Beanstalk Command Line Interface (EB CLI)

Elastic Beanstalk Command Line Interface (EB CLI)

Hello Everyone

Welcome to CloudAffaire and this is Debjeet.

In the last blog post, we have discussed environment configuration options in Elastic Beanstalk.

https://cloudaffaire.com/environment-configuration-options-in-elastic-beanstalk/

In this blog post, we will discuss command-line interface (EB CLI) in Elastic Beanstalk.

Elastic Beanstalk Command Line Interface (EB CLI):

The EB CLI is a command-line interface for Elastic Beanstalk that provides interactive commands that simplify creating, updating and monitoring environments from a local repository. You can use EB CLI as part of your everyday development and testing cycle as an alternative to the AWS Management Console.

Next, we are going to create an Elastic Beanstalk application using EB CLI.

Prerequisite for this demo:

  • One EC2 AWS Linux 2 instance with proper access.

Step 1: Install and configure EB CLI.

Step 2: Setup your application root directory.

Step 3: Create an application.

Observe: If you list hidden files, you can observe one file named .elasticbeanstalk automatically created. .elasticbeanstalk file is used by AWS Elastic Beanstalk to save your environment configuration in the form of config.yml file.

Next, we will create a custom configuration for our PHP environment.

Step 4: Create a custom configuration for your environment.

Note: You can create a custom configuration for your environment using .config files located in .ebextensions directory. We have placed our code in MyApplicationV1 directory, hence we are updating the root directory of our application so that it can serve web request from MyShoppingListV1 directory.

Step 5: Create an environment.

Our application successfully created.

Elastic Beanstalk Command Line Interface (EB CLI)

You can check your AWS Elastic Beanstalk console to validate the same.

Next, execute some basic eb cli commands to get your environment details.

Step 5: EB CLI basic commands.

Next, we are going to deploy a new environment version to this existing application.

Step 6: Deploy a new environment version.

Our new application environment version created successfully.

Elastic Beanstalk Command Line Interface (EB CLI)

Cleanup (Do not terminate if you continue with the next blog demo):

Hope you have enjoyed this article. In the next blog post, we will saved configuration in Elastic Beanstalk.

To get a complete list of EB CLI commands, please refer below AWS documentation.

https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb3-cmd-commands.html

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

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