Skip to content

Commit

Permalink
Merge pull request #147 from politics-rewired/politics-rewired/update…
Browse files Browse the repository at this point in the history
…-s3-signature-method

Update AWS S3 signature method.
  • Loading branch information
bchrobot authored May 10, 2019
2 parents b91b0e5 + 18dfc6f commit c97ff23
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/workers/jobs.js
Original file line number Diff line number Diff line change
Expand Up @@ -898,7 +898,10 @@ export async function exportCampaign(job) {
if (process.env.AWS_ACCESS_AVAILABLE || (process.env.AWS_ACCESS_KEY_ID && process.env.AWS_SECRET_ACCESS_KEY)) {
const objectKeyPrefix = process.env.AWS_S3_KEY_PREFIX || ''
try {
const s3bucket = new AWS.S3({ params: { Bucket: process.env.AWS_S3_BUCKET_NAME } })
const s3bucket = new AWS.S3({
signatureVersion: 'v4',
params: { Bucket: process.env.AWS_S3_BUCKET_NAME }
})
const campaignTitle = campaign.title.replace(/ /g, '_').replace(/\//g, '_')
const key = `${objectKeyPrefix}${campaignTitle}-${moment().format('YYYY-MM-DD-HH-mm-ss')}.csv`
const messageKey = `${key}-messages.csv`
Expand Down

0 comments on commit c97ff23

Please sign in to comment.