Set up the Elastic Beanstalk Command Line Interface
With AWS Elastic Beanstalk and AWS Identity and Access Management (IAM)
Introduction
In this step-by-step tutorial, you will set up the Elastic Beanstalk Command Line Interface (EB CLI). This is part one of a two-part tutorial. In the second half of EB CLI tutorial, you will deploy and monitor an application on the AWS cloud.
Elastic Beanstalk (EB) is a service used to deploy, manage, and scale web applications and services. You can use Elastic Beanstalk from the AWS Management console or from the command line using the Elastic Beanstalk Command Line Interface (EB CLI). You should use the EB CLI as part of your everyday development and testing cycle when you favor using the terminal.
You can use EB with popular languages and frameworks including Node, PHP, Java, Python, Ruby, .NET/IIS, Tomcat, Docker, and Multi-Container Docker.
During this part of the EB CLI tutorial, you will set up a user with the proper permissions then install the EB CLI.
Implementation
Create and set up an IAM user
In this step, you will create an IAM user and grant access for the user to use AWS from the command line. Next, you will grant the user an Elastic Beanstalk IAM permission. Finally, you will download the user credentials for use later in the tutorial.
1. Open the IAM Console
Open the AWS Identity and Access Management (IAM) console. In the navigation pane on the left, select Users.

2. Add a new user
Select Add user.

3. Configure users
For User name, enter eb-admin.
To use the EB CLI with the eb-admin user, it needs programmatic access to AWS. But to use the EB CLI, eb-admin does not need access to the AWS Management console.
Understanding that, for Access type, choose Programmatic access.
Leave AWS Management Console access unchecked.
Select Next: Permissions.

4. Add user to group
Select Add user to group then select Create group.

5. Configure group
In the Group name field, enter eb-admins. In the policy section of this screen, you need to select the IAM policy which grants members of the group full access to Elastic Beanstalk.
In the policy search box, type AWSElasticBeanstalkFullAccess.
Select AWSElasticBeanstalkFullAccess and select Create group.

6. Verify the policy is attached
You will see eb-admin created with the AWSElasticBeanstalkFullAccess policy attached to the group.
Select Next: Review.

7. Review configuration
Review your user details and permissions. Select Create group.
8. Download credentials
In a later step, you will need to use eb-admin's access key from this page.
Save the access key and secret access key on your workstation by selecting Download .csv. Select Close.

Install the EB CLI
In this step, you will install the EB command line interface. Follow the OS specific configuration steps.
Install the EB CLI on Windows
Download and install Python 3.6+ by going to the Python Software Foundation website and choose the version of Python for your OS. Make sure and select Add Python to environment variables in the Python installer so Python will work from any command line location. The Python installer will install Python and the pip package manager.
Start the Windows Command Prompt using the Run Window (Win +R on your keyboard) and typing cmd then pressing Enter.
Using the Windows Command Prompt, confirm that Python is installed properly by running:
python --version
Using the Windows Command Prompt, confirm that pip is installed properly by running:
pip --version
Now that Python and pip has been installed, install the EB CLI by running:
pip install awsebcli --upgrade --use
Now confirm that the EB CLI is installed correctly by running:
eb --version

Install the EB CLI on Linux
Your modern Linux distro probably includes Python by default. Confirm that Python is installed by starting a terminal session and running the following command:
python -–version
If your Python Version is 2.7, continue with these installation instructions. If your Python is greater than 2.7, do not use these installation instructions. Use the comprehensive EB CLI installation instructions .
Now confirm that the pip Python package manager is installed by running the following command:
pip -–version
Now that Python and pip have been verified, install the EB CLI by running:
pip install awsebcli --upgrade --user
Now confirm that the EB CLI is installed correctly by running:
eb –-version
Install the EB CLI on macOS
Start the MacOS terminal application.
If you have the Homebrew package manager on your mac, update your homebrew fomulae by running the following command in Terminal:
brew update
If you don't have the the Homebrew package manager installed, install it by running the following command in Terminal:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Using Homebrew, install the EB CLI by running the following command in Terminal:
brew install awsebcli
Now confirm that the EB CLI is installed correctly by running:
eb --version
Congratulations!
Did you find what you were looking for today?
Let us know so we can improve the quality of the content on our pages