What You Will Learn
Beginner
- How to install the AWS CLI
- How to configure credentials
- Basic CLI commands
Installation
Terminalbash
# macOS
brew install awscli
# Windows
msiexec.exe /i https://awscli.amazonaws.com/AWSCLIV2.msi
# Linux
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install
# Verify
aws --versionConfiguration
Terminalbash
aws configure
# Enter:
# AWS Access Key ID: YOUR_KEY
# AWS Secret Access Key: YOUR_SECRET
# Default region: us-east-1
# Default output format: jsonWhere to get keys
Go to IAM -> Users -> Your User -> Security credentials -> Create access key. NEVER commit these to git.First Commands
Terminalbash
# List S3 buckets
aws s3 ls
# List EC2 instances
aws ec2 describe-instances
# Get caller identity (who am I?)
aws sts get-caller-identityPractical Exercise
Install the AWS CLI
Run
aws configure with your keysRun
aws sts get-caller-identity — verify it worksRun
aws s3 ls — list your S3 bucketsKey Takeaways
- Install with brew (Mac), msi (Windows), or curl (Linux).
- Configure with
aws configure— needs access key + region. - Get keys from IAM -> Users -> Security credentials.
aws sts get-caller-identityverifies your setup.- NEVER commit access keys to git.
Comments
Comments
Post a Comment