You bought a Mac M1/M2/M3/M4/& MLDR;/M99 at gold prices, but AWS treats you as if you still had an old PC under Windows 95 !!

Indeed, Amazon, giant of the cloud capable of turning three quarters of the internet, has still not understood that Apple had been doing a Mac Intel since 2022… Bouuuuh! And that, it is problematic Because when you want to install the AWS (AWS-CLI) command line interface on a Mac Silicon, to interact with the Amazon Webservices services directly from its terminal or scripts, it’s relou !

For what ?

Simply because Apple Silicon chips use an Arm architecture different from the old Intel X86 chips. And as the official AWS instructions are still blocked in the Middle Ages of Intel, you should normally get into Bash acrobatics.

Fortunately, thanks to Carlos Nunez, we can install AWS CLI on Mac ARM using script available here Who does in 30 seconds what Ws has failed to do in 3 years … This script is perfect if you hate Homebrew or if you manage a fleet of machines and prefer a clean solution without packet manager.

Quick installation

Open your terminal then run the following command for standard installation:

curl https://raw.githubusercontent.com/carlosonunez/awscli-installer-apple-silicon/refs/heads/main/install.sh | bash

To install a specific version (ex: 2.20.0):

curl https://raw.githubusercontent.com/carlosonunez/awscli-installer-apple-silicon/refs/heads/main/install.sh | bash -s -- --version 2.20.0

If you already have an installed version and want to force resettlement:

FORCE=1 curl https://raw.githubusercontent.com/carlosonunez/awscli-installer-apple-silicon/refs/heads/main/install.sh | bash

The script is rather clever since it downloads the AWS CLI source code from GitHub, checks that you are of course MacOS, ensures that Python is installed, then compiles and installs the CLI natively for your ARM architecture. It’s clean, it’s elegant, it does not depend on Rosetta 2 and it does not pollute your system with unnecessary dependencies.

At the end of the installation, the script will tell you how to correctly configure your path and activate self -compulsory. If you are as lazy as I am content to copy and paste the commands he suggests in your terminal.

To check that everything works, just launch:

Please note, small point of attention for those working with EKS (Elastic Kubernetes Service): you will have to install the AWS IAM Authenticator separately. You can find them here.

Anyway, I love this type of solution which once again shows that developers are often faster than large boxes to solve concrete problems. If you use AWS regularly on your Mac Silicon, share this script with your colleagues, they will thank you for saving their mental health.


Source link

Categorized in: