From 5155aa3d0782f4baf3fc31fe88ac99eedc405be4 Mon Sep 17 00:00:00 2001 From: ryanp Date: Tue, 11 Aug 2015 11:56:58 -0500 Subject: [PATCH] s3 client --- lib/models/aws.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/models/aws.js b/lib/models/aws.js index 36f9f2709..dfdb5834e 100644 --- a/lib/models/aws.js +++ b/lib/models/aws.js @@ -12,7 +12,7 @@ var DynamoDbDOC = require('dynamodb-doc'); // static vars to save memory var dynamoDbDocClient, dynamoDbClient; -var lambdaClient, sesClient; +var lambdaClient, sesClient, s3Client; // Creds read from IAM role or ENV in dev if (Config.aws.logger) { @@ -22,7 +22,8 @@ if (Config.aws.logger) { AWS.config.apiVersions = { dynamodb: '2012-08-10', lambda: '2015-03-31', - ses: '2010-12-01' + ses: '2010-12-01', + s3: '2006-03-01' }; /** @@ -87,4 +88,13 @@ module.exports.getLambda = function () { */ module.exports.getSes = function () { return (sesClient) ? sesClient : new AWS.SES(); +}; + +/** + * Get static copy of S3 client + * + * @returns {*} + */ +module.exports.getS3 = function () { + return (s3Client) ? s3Client : new AWS.S3(); }; \ No newline at end of file