0% found this document useful (0 votes)
34 views6 pages

AWS Cheatsheet

Aws

Uploaded by

hzm753159
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views6 pages

AWS Cheatsheet

Aws

Uploaded by

hzm753159
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

CHEATSHEET

Basic Commands

An AWS CLI command has the following structure:


$ aws <command> <subcommand> [options and parameters]

For example, to list S3 buckets, the command would be:


$ aws s3 ls

$ aws help
$ aws <command> help
$ aws <command> <subcommand> help

View help documentation.

$ aws --version

Get the version of the AWS CLI.


CHEATSHEET

Basic Commands

$ aws --debug <command> <subcommand>

Turn on debugging output.

EC2
$ aws ec2 run-instances --image-id ami-a0b1234 --instance-
type t2.micro --security-group-ids sg-00000000 --dry-run

Create a new EC2 instance.

$ aws ec2 describe-instances --instance-ids i-5203422c

Describe an Amazon EC2 instance.

$ aws ec2 describe-instances --filters "Name=instance-


type,Values=t1.micro"

Create a new EC2 instance.

$ aws ec2 describe-instances --filters "Name=tag-


key,Values=Owner"

Describe all instances with an Owner tag.

$ aws ec2 terminate-instances --instance-ids <instance_id>

Stop an instance.
CHEATSHEET

Security Groups
$ aws ec2 describe-security-groups

List all security groups.

$ aws ec2 create-security-group --vpc-id vpc-1a2b3c4d --


group-name web-access --description "web access"

Create a security group

$ aws ec2 delete-security-group --group-id sg-00000000

Delete a security group

AWS IAM
$ aws iam create-user --user-name UserName

Create new user.

$ aws iam list-users

List all user's info

$ aws iam list-users --output text | cut -f 10

List all user's usernames.


CHEATSHEET

AWS IAM

$ aws iam delete-user --user-name UserName

Delete a user.

Access Keys
$ aws iam create-access-key --user-name UserName --output
text | tee UserName.txt

Create a new access key.

$ aws iam list-access-keys

List all access keys.

$ aws iam delete-access-key --access-key-id


THINKPORTIDK4EXAMPLE --user-name UserName

Delete an access keys.

AWS S3
$ aws s3 mb s3://<bucketName>

Create new bucket.

$ aws s3 ls

List S3 buckets.
CHEATSHEET

AWS S3

$ aws s3 ls s3://<bucketName>

List bucket content.

$ aws s3 rb s3://<bucketName>

Remove an empty bucket.

$ aws s3 sync <local> s3://<bucketName>

Sync objects.

Groups and Policies


$ aws iam create-group --group-name GroupName

Create a group

$ aws iam list-groups

List all groups.

$ aws iam delete-group --group-name GroupName

Delete a group.

$ aws iam list-policies

List all policies.


CHEATSHEET

Groups and Policies

$ aws iam get-policy --policy-arn

Get a specific policy.

$ aws iam add-user-to-group --group-name GroupName --user-


name UserName

Add a user to a specific group.

$ aws iam remove-user-from-group --group-name GroupName --


user-name UserName

Remove a user from a specific group

$ aws iam delete-group --group-name GroupName

Delete a specific group.

You might also like