mirror of
https://github.com/chubin/cheat.sheets
synced 2024-11-17 09:25:32 +00:00
44 lines
1.2 KiB
Plaintext
44 lines
1.2 KiB
Plaintext
# aws
|
|
# ???
|
|
|
|
# Install AWS CLI, using a Python package installer. This is available in the
|
|
# Ubuntu 16.04 repositories, so is probably available in other distributions'
|
|
# repositories, therefore I'd recommend using that unless otherwise required.
|
|
pip install awscli
|
|
|
|
# Configure AWS CLI.
|
|
aws configure
|
|
|
|
# Describe instances in the current account.
|
|
aws ec2 describe-instances --instance-ids i-01234567
|
|
|
|
# List public IP addresses of instances.
|
|
aws ec2 describe-instances \
|
|
--query "Reservations[*].Instances[*].PublicIpAddress" \
|
|
--output=text
|
|
|
|
# Start instance with the specified ID.
|
|
aws ec2 start-instances --instance-ids i-12345678c
|
|
|
|
# Copy directory to S3.
|
|
aws s3 cp ${directory} s3://${bucket}/${directory} --recursive
|
|
|
|
# Sync directory with S3.
|
|
aws s3 sync ${directory} s3://${bucket}/${directory} --exclude *.tmp
|
|
|
|
# List S3 buckets.
|
|
aws s3 ls
|
|
|
|
# Remove S3 bucket.
|
|
aws s3 rb --force s3://${bucket_name}
|
|
|
|
# Get bucket logging.
|
|
aws s3api get-bucket-logging --bucket ${bucket_name}
|
|
|
|
# AWS cloudformation list stacks.
|
|
aws cloudformation list-stacks \
|
|
--stack-status-filter [ CREATE_COMPLETE | UPDATE_COMPLETE | etc.. ]
|
|
|
|
# Follow the below link for some other useful commands.
|
|
# https://github.com/toddm92/aws/wiki/AWS-CLI-Cheat-Sheet
|