To activate and configure the AWS CLI on a Mac, follow these steps:

1. Install AWS CLI

Using Homebrew

The easiest way to install AWS CLI on macOS is through Homebrew.

a. Open Terminal

b. Install Homebrew (if you don’t have it already):

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

c. Install AWS CLI:

brew install awscli

Direct Download

Alternatively, you can download the AWS CLI directly from the AWS website.

a. Download and run the installer:

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

b. Verify the installation:

After installation, verify the AWS CLI version:

aws --version

You should see output similar to:

aws-cli/2.12.4 Python/3.11.4 Darwin/22.6.0 exe/x86_64 prompt/off

2. Configure AWS CLI

After installation, you need to configure the AWS CLI with your credentials.

a. Run the configure command:

aws configure

b. Enter your AWS Access Key ID:

You can find this in the AWS Management Console under IAM > Users > Your User > Security credentials.

c. Enter your AWS Secret Access Key:

This is also found in the same location as your Access Key ID.

d. Specify your default region name:

Pease use us-east-1 because as of now, Tensorfuse only supports this region.

e. Specify your default output format:

You can choose json, text, or table.

3. Verify the Configuration

To verify that the AWS CLI is configured correctly:

a. List your S3 buckets:

aws s3 ls

If everything is set up correctly, this will return a list of your S3 buckets.

By following these steps, you will have successfully installed and configured the AWS CLI on your macOS, allowing you to manage AWS resources directly from the command line.