fix: #1973 deploy fails with unhelpful error message when service name is not a valid CF stack name

This commit is contained in:
zorrofox 2016-09-23 23:04:34 +08:00
parent 73617d0a66
commit dbeaa54832

View File

@ -32,7 +32,7 @@ module.exports = {
createStack() {
const stackName = `${this.serverless.service.service}-${this.options.stage}`;
if (/^[a-zA-Z-]+/.test(stackName) || stackName.length > 128){
if (/^[a-zA-Z1-9-]+/.test(stackName) || stackName.length > 128){
const errorMessage = [
'The stack name "' + stackName + '" is not quallify. ',
'A stack name can contain only alphanumeric',