Last active
August 29, 2015 14:07
-
-
Save spjmurray/cc935c59569d1bff184d to your computer and use it in GitHub Desktop.
S3 Bucket Creation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
token='I858I8ZG0L80D9D8EQI8' | |
secret='cWIxgBEzPWmZcUsmbreXfT8gJvn9PIbCsQO9Bvtr' | |
query=$1 | |
date=`date -Ru` | |
header="PUT\n${content_md5}\n${content_type}\n${date}\n${query}" | |
sig=`echo -en ${header} | openssl sha1 -hmac ${secret} -binary | base64` | |
curl -X PUT \ | |
-H "Date: ${date}" \ | |
-H "Authorization: AWS ${token}:${sig}" \ | |
"https://storage.datacentred.io${query}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment