diff --git a/README.md b/README.md index 67d5f61..ff90110 100644 --- a/README.md +++ b/README.md @@ -209,6 +209,15 @@ Useful when deploying applications to [fake-s3](https://github.com/jubos/fake-s3 *Default:* `0` + +### signatureVersion + +`signatureVersion` allows for setting the Signature Version. In the Asia Pacific (Mumbai), Asia Pacific (Seoul), EU (Frankfurt) and China (Beijing) regions, Amazon S3 supports only Signature Version 4. In all other regions, Amazon S3 supports both Signature Version 4 and Signature Version 2. + +*Example value*: `'v4'` + +*Default*: `undefined` + ## Prerequisites The following properties are expected to be present on the deployment `context` object: diff --git a/lib/s3.js b/lib/s3.js index 64a80f4..f912c86 100644 --- a/lib/s3.js +++ b/lib/s3.js @@ -28,6 +28,7 @@ module.exports = CoreObject.extend({ const secretAccessKey = this._plugin.readConfig('secretAccessKey'); const sessionToken = this._plugin.readConfig('sessionToken'); const profile = this._plugin.readConfig('profile'); + const signatureVersion = this._plugin.readConfig('signatureVersion'); if (accessKeyId && secretAccessKey) { this._plugin.log('Using AWS access key id and secret access key from config', { verbose: true }); @@ -35,6 +36,11 @@ module.exports = CoreObject.extend({ s3Options.secretAccessKey = secretAccessKey; } + if (signatureVersion) { + this._plugin.log('Using signature version from config', { verbose: true }); + s3Options.signatureVersion = signatureVersion; + } + if (sessionToken) { this._plugin.log('Using AWS session token from config', { verbose: true }); s3Options.sessionToken = sessionToken;