A note to AWS Cli for quick setup.

basic Setup

aws configure
1

to enter:

  • access key id
  • secret access key
  • default region in region list (one of them)

Demo Image

location for aws to store credentials

linux

cd ~ cd .aws in the credentials file config file store default region of aws

windows

dir "%UserProfile%.aws"

s3

aws s3 help - show command help aws s3 ls - list s3 bucket

aws s3 cp --recursive s3://{bucketname} /home/{local linux location} --region eu-west-2
some region need to use region argument

ec2

aws ec2 describe-instance - list instance detail (including InstanceId)
aws ec2 describe-images - list available ami for ec2
aws ec2 describe-images --owners amazon --filters "Name=platform,Values=windows" "Name=root-device-type,Values=ebs" - describe all windows ami
aws ec2 terminate-instances --instance-ids {InstanceId} - terminate instance

launch EC2 instance

aws ec2 run-instances --image-id ami-abc12345 --count 1 --instance-type t2.micro --key-name MyKeyPair --security-group-ids sg-1a2b3c4d --subnet-id subnet-6e7f829e

aws ec2 run-instances --image-id {found in cli describe images, commands as above} --count 1 --instance-type t2.micro --key-name {found in ec2 session in ec2 console} --security-group-ids {found in other ec2 or vpc} --subnet-id subnet-6e7f829e

EC2 available commands

Last Updated: 1/14/2019, 12:15:15 AM