From b8e5bb4eca1b9d92e263e580b484b9efbbc7b8cf Mon Sep 17 00:00:00 2001 From: zorrofox Date: Fri, 23 Sep 2016 23:59:13 +0800 Subject: [PATCH] fix: #1973 deploy fails with unhelpful error message when service name is not a valid CF stack name --- lib/plugins/aws/deploy/lib/createStack.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/plugins/aws/deploy/lib/createStack.js b/lib/plugins/aws/deploy/lib/createStack.js index c62e88ab2..3b25bda07 100644 --- a/lib/plugins/aws/deploy/lib/createStack.js +++ b/lib/plugins/aws/deploy/lib/createStack.js @@ -32,7 +32,7 @@ module.exports = { createStack() { const stackName = `${this.serverless.service.service}-${this.options.stage}`; - if (/^[a-zA-Z1-9-]+/.test(stackName) || stackName.length > 128){ + if (/^[^a-zA-Z].+|.*[^a-zA-Z0-9\-].*/.test(stackName) || stackName.length > 128){ const errorMessage = [ 'The stack name "' + stackName + '" is not quallify. ', 'A stack name can contain only alphanumeric',