diff --git a/lib/plugins/aws/deploy/lib/uploadArtifacts.js b/lib/plugins/aws/deploy/lib/uploadArtifacts.js index 57484fc3f13..29628b91524 100644 --- a/lib/plugins/aws/deploy/lib/uploadArtifacts.js +++ b/lib/plugins/aws/deploy/lib/uploadArtifacts.js @@ -21,7 +21,7 @@ module.exports = { uploadCloudFormationFile() { this.serverless.cli.log('Uploading CloudFormation file to S3...'); - const compiledTemplateFileName = 'compiled-cloudformation-template.json'; + const compiledTemplateFileName = this.provider.naming.getCompiledTemplateS3Suffix(); const compiledCfTemplate = this.serverless.service.provider.compiledCloudFormationTemplate; const normCfTemplate = normalizeFiles.normalizeCloudFormationTemplate(compiledCfTemplate); diff --git a/lib/plugins/aws/deploy/lib/validateTemplate.js b/lib/plugins/aws/deploy/lib/validateTemplate.js index b11c15ff792..35256439459 100644 --- a/lib/plugins/aws/deploy/lib/validateTemplate.js +++ b/lib/plugins/aws/deploy/lib/validateTemplate.js @@ -1,11 +1,12 @@ 'use strict'; +const getCompiledTemplateS3Suffix = require('../../lib/naming').getCompiledTemplateS3Suffix; const getS3EndpointForRegion = require('../../utils/getS3EndpointForRegion'); module.exports = { validateTemplate() { const bucketName = this.bucketName; const artifactDirectoryName = this.serverless.service.package.artifactDirectoryName; - const compiledTemplateFileName = 'compiled-cloudformation-template.json'; + const compiledTemplateFileName = getCompiledTemplateS3Suffix(); const s3Endpoint = getS3EndpointForRegion(this.provider.getRegion()); this.serverless.cli.log('Validating template...'); const params = { diff --git a/lib/plugins/aws/lib/naming.js b/lib/plugins/aws/lib/naming.js index 9fe9a4b1f76..9e8ad0b6ea3 100644 --- a/lib/plugins/aws/lib/naming.js +++ b/lib/plugins/aws/lib/naming.js @@ -75,6 +75,10 @@ module.exports = { return 'cloudformation-template-update-stack.json'; }, + getCompiledTemplateS3Suffix() { + return 'compiled-cloudformation-template.json'; + }, + getCoreTemplateFileName() { return 'cloudformation-template-create-stack.json'; }, diff --git a/lib/plugins/aws/lib/updateStack.js b/lib/plugins/aws/lib/updateStack.js index 2e1af627d65..0677d2d6336 100644 --- a/lib/plugins/aws/lib/updateStack.js +++ b/lib/plugins/aws/lib/updateStack.js @@ -13,7 +13,7 @@ module.exports = { const stackName = this.provider.naming.getStackName(); let stackTags = { STAGE: this.provider.getStage() }; - const compiledTemplateFileName = 'compiled-cloudformation-template.json'; + const compiledTemplateFileName = this.provider.naming.getCompiledTemplateS3Suffix(); const s3Endpoint = getS3EndpointForRegion(this.provider.getRegion()); const templateUrl = `https://${s3Endpoint}/${this.bucketName}/${this.serverless.service.package.artifactDirectoryName}/${compiledTemplateFileName}`; @@ -52,7 +52,7 @@ module.exports = { }, update() { - const compiledTemplateFileName = 'compiled-cloudformation-template.json'; + const compiledTemplateFileName = this.provider.naming.getCompiledTemplateS3Suffix(); const s3Endpoint = getS3EndpointForRegion(this.provider.getRegion()); const templateUrl = `https://${s3Endpoint}/${this.bucketName}/${this.serverless.service.package.artifactDirectoryName}/${compiledTemplateFileName}`; diff --git a/lib/plugins/aws/rollback/index.js b/lib/plugins/aws/rollback/index.js index acc314bb8e5..39e3b5525a9 100644 --- a/lib/plugins/aws/rollback/index.js +++ b/lib/plugins/aws/rollback/index.js @@ -70,7 +70,7 @@ class AwsRollback { const exists = _.some(deployments, deployment => _.some(deployment, { directory: dateString, - file: 'compiled-cloudformation-template.json', + file: this.provider.naming.getCompiledTemplateS3Suffix(), }) );