Upload file to s3
?
R
BashScript to upload file to s3
1#!/bin/bash
2file=$1
3bucket=seedv2
4resource="/${bucket}/${file}"
5contentType="application/x-compressed"
6dateValue=`date -R`
7stringToSign="PUT\n\n${contentType}\n${dateValue}\n${resource}"
8s3Key=AKIAQCMIJZIEFZS6N462
9s3Secret=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
10echo "SENDING TO S3"
11signature=`echo -en ${stringToSign} | openssl sha1 -hmac ${s3Secret} -binary | base64`
12curl -vv -X PUT -T "${file}" \
13 -H "Host: ${bucket}.s3.amazonaws.com" \
14 -H "Date: ${dateValue}" \
15 -H "Content-Type: ${contentType}" \
16 -H "Authorization: AWS ${s3Key}:${signature}" \
17 https://${bucket}.s3.amazonaws.com/${file}$Created on 1/18/2022