AWS CLI Cheatsheet
AWS CLI Cheatsheet
AWS CLI Cheatsheet
If you haven't installed AWS CLI yet start at the Installing the AWS CLI Guide from
Amazon.
Config
Create profiles
Juniper
Business
Use Only
aws configure --profile profilename
Output format
API Gateway
List API Gateway IDs and Names
Juniper
Business
Use Only
Amplify
List Amplify apps and source repository
CloudFront
List CloudFront distributions and origins
CloudWatch
List information about an alarm
Cognito
List user pool IDs and names
Juniper
Business
Use Only
aws cognito-idp list-user-pools --max-results 60 | jq -r ‘.UserPools[ ] | .Id+”
“+.Name’
DynamoDB
List DynamoDB tables
Juniper
Business
Use Only
EBS
Complete a Snapshot
Start a Snapshot
EC2
List Instance ID, Type and Name
Juniper
Business
Use Only
Juniper
Business
Use Only
ECS
Create an ECS cluster
EKS
Create a cluster
Delete a cluster
Juniper
Business
Use Only
aws eks describe-cluster --name (cluster name)
Tag a resource
Untag a resource
ElastiCache
Get information about a specific cache cluster
Juniper
Business
Use Only
ELB
List ELB Hostnames
IAM Group
Juniper
Business
Use Only
List groups
Add/Delete groups
Juniper
Business
Use Only
aws iam remove-user-from-group --group-name (groupname) --user-name (username)
IAM User
List userId and UserName
Add user
Delete user
Juniper
Business
Use Only
Lambda
List Lambda functions, runtime, and memory
Juniper
Business
Use Only
aws lambda list-event-source-mappings | jq -r ‘.EventSourceMappings[ ] |
.FunctionArn+” “+.EventSourceArn’
RDS
List DB clusters
List DB instances
Route53
Create hosted zone
Juniper
Business
Use Only
To do this you’ll first need to create a JSON file with a list of change items in the
body and use the CREATE action. For example the JSON file would look like this.
{
"Comment": "CREATE/DELETE/UPSERT a record",
"Changes": [{
"Action": "CREATE",
"ResourceRecordSet":{
"Name": "a.example.com",
"Type": "A",
"TTL": 300,
"ResourceRecords":[{"Value":"4.4.4.4"}]
}}]
}
Once you have a JSON file with the correct information like above you will be able
to enter the command
Juniper
Business
Use Only
To do this you’ll first need to create a JSON file with a list of change items in the
body and use the UPSERT action. This will either create a new record set with the
specified value, or updates a record set if it already exists. For example the JSON
file would look like this.
{
"Comment": "CREATE/DELETE/UPSERT a record",
"Changes": [{
"Action": "UPSERT",
"ResourceRecordSet":{
"Name": "a.example.com",
"Type": "A",
"TTL": 300,
"ResourceRecords": [{"Value":"4.4.4.4"}]
}}]
}
Once you have a JSON file with the correct information like above you will be able
to enter the command
To do this you’ll first need to create a JSON file with a list of the record set values
you want to delete in the body and use the DELETE action. For example the JSON
file would look like this.
{
"Comment": "CREATE/DELETE/UPSERT a record",
"Changes": [{
"Action": "DELETE",
"ResourceRecordSet": {
"Name": "a.example.com",
"Type": "A",
"TTL": 300,
"ResourceRecords": [{"Value":"4.4.4.4"}]
}}]
}
Juniper
Business
Use Only
Once you have a JSON file with the correct information like above you will be able
to enter the following command.
S3
List Buckets
aws s3 ls
aws s3 ls s3://mybucket
Create Bucket
aws s3 mb s3://bucket-name
make_bucket: bucket-name
Delete Bucket
aws s3 cp s3://bucket-name
download: ./backup.tar from s3://bucket-name/backup.tar
Juniper
Business
Use Only
Delete S3 object
aws s3 rm s3://bucket-name/secret-file.gz .
delete: s3://bucket-name/secret-file.gz
SNS
List SNS topics
Juniper
Business
Use Only
SQS
List queues
Create queue
Send message
Receive message
Delete message
Purge queue
Juniper
Business
Use Only
Delete queue
Juniper
Business
Use Only