Below steps explains how to setup AWS CLI on MacOS Terminal with Apple Chip.
Steps to install AWS CLI in Mac
1. Open Terminal and download the awscli-bundle.zip using below curl command.
curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip"
2. Extract (unzip) the files from the package.
unzip awscli-bundle.zip
3. Install Python 3.10 from below link
Click on macOS 64-bit universal2 installer and downloads the installer package.
Install the Python package.
4. Install the AWS CLI using below command.
sudo /usr/local/bin/python3.10 awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws
5. Login to your AWS account and export below variables in your Mac Terminal to setup the programmatic access.
export AWS_ACCESS_KEY_ID="XXXXX"
export AWS_SECRET_ACCESS_KEY="XXXXX"
export AWS_SESSION_TOKEN="XXXXX"
export AWS_DEFAULT_REGION="Your AWS Region"
6. Test if your setup is successful
aws s3 ls