Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when creating aliases with "-" in the name #68

Closed
arabold opened this issue Jul 14, 2017 · 7 comments
Closed

Error when creating aliases with "-" in the name #68

arabold opened this issue Jul 14, 2017 · 7 comments
Labels
Milestone

Comments

@arabold
Copy link

arabold commented Jul 14, 2017

I've tried to deploy a new alias called "my-test" using sls deploy --alias my-test. Unfortunately this fails with an exception:

  The CloudFormation template is invalid: Template format error: Resource name IamRoleLambdaExecutionmy-test is non alphanumeric.

The alias stack is still created and not cleaned up properly. I suggest to simply use camel casing when appending the alias name to CloudFormation resources. That would fix this while still allowing non alphanumeric characters in the alias name itself.

@HyperBrain HyperBrain added the bug label Jul 14, 2017
@HyperBrain
Copy link
Member

HyperBrain commented Jul 15, 2017

I will use normalized alias names internally. The dashes have to be replaced by Dash (others too) to eliminate disambiguities like my-test and my--test which would lead to the same myTest if using a common camel case transform like _.camelCase().
The way Serverless does it in its naming module should be the way to go.

@mbruning24
Copy link

Any update on when this might be added in? Our team would love to tie this into our automated deployment (we tag our assets based on JIRA story key, which contains dashes!). Love this plugin so far.

@HyperBrain
Copy link
Member

@mbruning24 Sorry, that there wasn't any progress on that yet. I was quite busy with serverless-webpack which I ... suddenly ... took over.

Adding this should not be much efforts if it is only done for the rule name, and only if it contains disallowed characters (which is a fixed set) to stay backwards compatible.
I think I can have a look this weekend.

@HyperBrain
Copy link
Member

Released with 1.5.1

@piether
Copy link

piether commented May 27, 2019

FYI, this issue is mentioned as "Support _ - + in alias names #68" in the README, but only hyphens work. If I try to use a + or _ I get
The stack alias name "..." is not valid. A service name should only contain alphanumeric (case sensitive) and hyphens. It should start with an alphabetic character and shouldn't exceed 128 characters.

@chosme
Copy link

chosme commented Aug 14, 2019

Any update on the above mentioned query.
I get an error if I use "_"
The stack alias name "..." is not valid. A service name should only contain alphanumeric (case sensitive) and hyphens. It should start with an alphabetic character and shouldn't exceed 128 characters.

@Enase
Copy link
Contributor

Enase commented Aug 14, 2019

@chosme could you provide serverless.yml example?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants