From 46d446689842698934b2ca288d8fa4487f4b145e Mon Sep 17 00:00:00 2001 From: Max Redmond Date: Thu, 25 May 2017 12:05:35 -0400 Subject: [PATCH] adding serverside encryption options to deployment bucket in the provider section of serverless.yml --- lib/plugins/aws/deploy/lib/uploadArtifacts.js | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/lib/plugins/aws/deploy/lib/uploadArtifacts.js b/lib/plugins/aws/deploy/lib/uploadArtifacts.js index 6c7ad61d2..baafe8e6e 100644 --- a/lib/plugins/aws/deploy/lib/uploadArtifacts.js +++ b/lib/plugins/aws/deploy/lib/uploadArtifacts.js @@ -18,7 +18,15 @@ module.exports = { Body: body, ContentType: 'application/json', }; - + if (this.serverless.service.provider.deploymentBucketOptions.sse){ + params.ServerSideEncryption = this.serverless.service.provider.deploymentBucketOptions.sse + } + if (this.serverless.service.provider.deploymentBucketOptions.sseKmsKeyId){ + params.SSEKMSKeyId = this.serverless.service.provider.deploymentBucketOptions.sseKmsKeyId + } + if (this.serverless.service.provider.deploymentBucketOptions.sseCustomerKey){ + params.SSECustomerKey = this.serverless.service.provider.deploymentBucketOptions.sseCustomerKey + } return this.provider.request('S3', 'putObject', params, @@ -35,6 +43,15 @@ module.exports = { Body: fs.createReadStream(artifactFilePath), ContentType: 'application/zip', }; + if (this.serverless.service.provider.deploymentBucketOptions.sse){ + params.ServerSideEncryption = this.serverless.service.provider.deploymentBucketOptions.sse + } + if (this.serverless.service.provider.deploymentBucketOptions.sseKmsKeyId){ + params.SSEKMSKeyId = this.serverless.service.provider.deploymentBucketOptions.sseKmsKeyId + } + if (this.serverless.service.provider.deploymentBucketOptions.sseCustomerKey){ + params.SSECustomerKey = this.serverless.service.provider.deploymentBucketOptions.sseCustomerKey + } return this.provider.request('S3', 'putObject',