From 6873abda0d4292c79098bb3aef0b3fd69dbc80c2 Mon Sep 17 00:00:00 2001 From: Max Redmond Date: Thu, 25 May 2017 13:22:45 -0400 Subject: [PATCH] adding a check for deploymentBucketOptions checking if deploymentBucketOptions exists in the yaml so that you can deploy without any deploymentBucketOptions defined --- lib/plugins/aws/deploy/lib/uploadArtifacts.js | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/lib/plugins/aws/deploy/lib/uploadArtifacts.js b/lib/plugins/aws/deploy/lib/uploadArtifacts.js index baafe8e6e..a92cce804 100644 --- a/lib/plugins/aws/deploy/lib/uploadArtifacts.js +++ b/lib/plugins/aws/deploy/lib/uploadArtifacts.js @@ -43,16 +43,19 @@ 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 - } + if(this.serverless.service.provider.deploymentBucketOptions){ + 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,