Setting up your local environment for AWS is a fundamental step for any developer or DevOps enthusiast.
If you’re looking to get started with AWS, the first and most crucial step is to set up the AWS Command Line Interface (CLI). This powerful tool allows you to manage your AWS services directly from your terminal, which is essential for automation and efficient workflows.
This guide will walk you through the entire process, from installing the necessary tools to configuring the CLI with your credentials. Let’s dive in!
Steps
Step 1: Install Homebrew (If You Haven’t Already) 🍻
If you don’t already have it, Homebrew is a must-have package manager for macOS. It simplifies your daily developer life by making package installation a breeze, often with a single command.
Visit the Homebrew homepage at https://brew.sh/ for the latest instructions.
OR else execute the following command
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Once installed, it’s always good practice to ensure everything is up-to-date:
brew update
Step 2: Install AWS CLI 📥
execute:
brew install awscli
Homebrew will download and install the latest version of the official AWS CLI.
Step 3: Login to AWS console
To use the CLI, you need credentials. We’ll generate a unique Access Key ID and Secret Access Key from the AWS Management Console.
- Navigate to the AWS Console: https://aws.amazon.com/console/
And click on the Sign in button
Step 4. Once logged in, go to security credentials page
- Click on your name at the right top corner
- On the popup menu, click on the “Security credentials”
Step 5. Generate Your Access Keys in AWS Console 🔑
- Scroll down to the Access keys section
- Click the Create access key button
- A key pair will be generated. Crucially, copy and save both keys immediately and securely. Treat your Secret Access Key like a password!
💡 Pro Tip: For production use, consider securing these keys using AWS services like Secrets Manager instead of storing them locally.
Step 6: Configure the AWS CLI ⚙️
Run the main configuration command:
aws configure
The CLI will prompt you for four pieces of information:
AWS Access Key ID: Use the Access key you just generated (first one)
AWS Secret Access Key: Use the Secret access key you just generated (Second one)
Default region name: us-east-1 (Use yours)
Default output format: You can press Enter to accept the default, which is JSON.
*How to find your region name?
To find your default region, look at the top-right corner of the AWS Management Console. The current region you are in will be displayed there e.g., United States (N. Virginia), click it
- Get the selected region identifier, for me this is us-east-1
Step 7: Test Your Setup! ✅
A successful configuration means you can now interact with AWS! Let’s run a simple test.
The following command will list all the available top-level commands in the CLI. If it runs without errors, you’re golden!
aws help
CONGRATULATIONS! 🎉 You’re officially set up and ready to start mastering your AWS resources directly from your command line. Go forth and automate!
Top comments (0)