Other Examples:
This page provides AWS CLI (Command Line Interface) notes and examples. The AWS CLI is a powerful tool for managing AWS services from your terminal. Here are some useful tips and examples to help you get started.
Before using the AWS CLI, you need to configure it with your AWS credentials. You can do this by running:
aws configure
This command will prompt you for your AWS Access Key ID, Secret Access Key, default region name, and output format.
Here are some common AWS CLI commands:
- List S3 buckets:
aws s3 ls -
Copy a file to S3:
aws s3 cp myfile.txt s3://mybucket/ -
Describe an EC2 instance:
aws ec2 describe-instances --instance-ids i-xxxxxxxxxxxxxxxxx
You can use the --query option to filter the output of
AWS CLI commands. For example, to get the public IP address of an
EC2 instance:
aws ec2 describe-instances --instance-ids i-xxxxxxxxxxxxxxxxx --query 'Reservations[0].Instances[0].PublicIpAddress'
For more detailed information and examples, refer to the official AWS CLI documentation.