Lesson 23 / 26
The AWS CLI
Scripting and automating AWS from the command line.
Why use the CLI
The AWS CLI lets you call any AWS API from your terminal or a script — useful for automation, CI/CD pipelines, and quick checks the console is slower for.
A couple of commands
List a bucket's contents, and list running EC2 instances.
aws s3 ls s3://my-app-bucket
aws ec2 describe-instances --filters "Name=instance-state-name,Values=running"
Output:
Lists objects, then running instance details as JSON
Configure credentials safely
Run aws configure to set an access key from an IAM user (not root), and prefer named profiles when working with multiple accounts.