DEV Community

Cover image for Installing and setting up AWS CLI on macOS
Isah Bashir Ibrahim
Isah Bashir Ibrahim

Posted on

Installing and setting up AWS CLI on macOS

Introduction

The AWS Command Line Interface (AWS CLI) is a uniform platform for managing your AWS resources. With just one tool to download and configure, you can control and automate various AWS services from the command line using scripts.

Prerequisite

  • AWS account

  • IAM user with programmatic access

Installing AWS CLI

Run this command to install AWS CLI on your local machine.

curl "https://awscli.amazonaws.com/AWSCLIV2.pkg" -o "AWSCLIV2.pkg”
Enter fullscreen mode Exit fullscreen mode
sudo installer -pkg AWSCLIV2.pkg -target /
Enter fullscreen mode Exit fullscreen mode

Verification

To verify that the shell can find and run the AWS command in your $PATH, use the following commands.

which aws
Enter fullscreen mode Exit fullscreen mode

You will get the output: /usr/local/bin/aws

Setup locally

Run this command to quickly set and view your credentials, Region, and output format. The following example shows sample values.

aws configure
Enter fullscreen mode Exit fullscreen mode

Note: Make sure to download your account credentials and input them after running this command.

This output will look like this if you successfully configure the CLI.

AWS Access Key ID [None]: ***AIO***DN**7EX****

AWS Secret Access Key [None]: w***rXU***MI/****G/**MP***Y

Default region name [None]: us-****-2

Default output format [None]: json

Top comments (0)