Skip to content

Instantly share code, notes, and snippets.

@ThomasThoren
Last active March 9, 2019 19:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ThomasThoren/94e537abedac0959fa2c to your computer and use it in GitHub Desktop.
Save ThomasThoren/94e537abedac0959fa2c to your computer and use it in GitHub Desktop.
AWSCLI

AWSCLI

sync

aws s3 sync \
  /home/tom/ \
  s3://mybucket/ \
  --exclude "*.DS_Store"

cp

aws s3 cp \
  /home/tom/ \
  s3://mybucket/ \
  --recursive \

Specify non-default AWS account using --profile different_account_name.

Creating new AWS keys

Create new access keys in AWS console. Note that you can only have two sets of keys at a time.

Navigate to the IAM console by clicking your user name in the dropdown menu in the banner at the top of the page. Then select the "Security Credentials" option. If a popup appears, select "Continue to Security Credentials".

In IAM console, click "Access Keys," "Create Access Keys," then "Download Credentials."

Configuring AWS CLI

While in your virtual environment (workon YourVirtualEnvironmentName), install awscli.

pip install awscli

Run aws configure. Enter the codes given in the credentials.csv download file, your region (us-west-2 or similar) and output (json or whichever you prefer). Key info is then stored in ~/.aws.

To test that everything is configured correctly, run this.

aws s3 ls s3://elections.thelensnola.org

Resources

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment