Install and Configure AWS CLI for Deployment

Rany ElHousieny
Level Up Coding
Published in
3 min readFeb 26, 2021

--

I will assume you have a vanilla machine with nothing installed related to AWS CLI. To make this easier, I will use the command-line instead of navigating through sites

First: Create A Free tier Amazon Account

We will need this to deploy to AWS. It is easy and straightforward. Just follow the instructions here https://aws.amazon.com/premiumsupport/knowledge-center/create-and-activate-aws-account/

Here is the Sign-Up page https://portal.aws.amazon.com/billing/signup#/start

1. Download AWS CLI V2

curl "https://awscli.amazonaws.com/AWSCLIV2.pkg" -o "AWSCLIV2.pkg"

2. Install awscli

sudo installer -pkg AWSCLIV2.pkg -target /

3. Verify the installation

aws --versionOutput will be close but not exact to the following:aws-cli/2.1.28 Python/3.8.8 Darwin/20.3.0 exe/x86_64 prompt/off

4. Install XCode command-line tools

xcode-select --install

Configure AWS CLI

1. Get Credentials

To be able to work with AWS CLI, you need to create a new user and get access key and secret. Let’s do this from the console. Please, follow the video before. It will be easier to explain in a video

1 — Search for IAM

2 — Select IAM and enter a name for the user (Here I used aws-cli)

3 — Select Programmatic access then Next: Permission

4 — Select Attach existing policies directly

5 — Select Administrator Access then Next: Tags

6 — Skipp tags and click Next: Preview

7 — Click Next: Create User

8 — Download the credentials CSV

9 — Open the downloaded file It will look similar to the following

We will use those Creds in Next Steps

10 — Open a command window / Terminal and write

aws configure

11 — It will ask you for AWS Access Key ID

put the one from the downloaded csv

12 — Add the AWS Secret Key from the same File

13 — Put your Region

Make sure to select the same region you used to create your resources (in my case, I use us-east-a)

You can test by running

aws s3 ls

Originally Published on LinkedIn:

--

--

https://www.linkedin.com/in/ranyelhousieny Commercial software development manager offering 25+ years of technical experience. Certified Solutions Architect