November 16 2018

AWS Cheatsheet

Install AWS Command Line Interface (CLI)

# apt install python3-pip
$ pip3 install --upgrade --user awscli

Configure AWS with CLI

' Get access id and key from AWS console > My Security Credentials 
$ aws configure
AWS Access Key ID [None]: <your-access-key>
AWS Secret Access Key [None]: <your-secret-key>
Default region name [None]: us-west-2
Default output format [None]: JSON

List S3 Buckets in AWS Account

$ aws s3 ls

Create S3 Bucket in AWS Account

$ aws s3 mb s3://<my_unique_bucket_id>

Off-site Backup to S3 Bucket

' With AWS CLI
$ aws s3 sync /<folder> s3://<my_unique_bucket_id>
' With Bash script
#!/bin/bash
/usr/local/bin/aws s3 sync /<folder> s3://<my_unique_bucket_id>