Set up the Elastic Beanstalk Command Line Interface with AWS Elastic Beanstalk and AWS Identity and Access Management (IAM)
AWS experience |
Beginner |
Cost to complete |
Free tier There is no additional charge for AWS Elastic Beanstalk. The resources you create in this tutorial are Free Tier eligible. |
Requirements |
An AWS account |
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
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.
-
Open the IAM Console
Open the AWS Identity and Access Management (IAM) console
. In the navigation pane on the left, select Users. -
Add a new user
Select Add user.
-
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.
-
Add user to group
Select Add user to group then select Create group.
-
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 AWSElasticBeanstalkFullAccessand select Create group.
-
Verify the policy is attached
You will see eb-admin created with the AWSElasticBeanstalkFullAccesspolicy attached to the group.
Select Next: Review.
-
Review configuration
Review your user details and permissions. Select Create group.
-
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.
In this step, you will install the EB command line interface. Follow the OS specific configuration steps.
Congratulations!
Congratulations, you have set up the Elastic Beanstalk Command Line Interface. You should use the EB CLI to deploy and manage applications whenever you want the power of Elastic Beanstalk from the command line.