-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
Added ability to create custom stack names and API names #4951
Added ability to create custom stack names and API names #4951
Conversation
@rts-cwalker @HyperBrain , If this PR addresses the concern in the earlier related PR is there any update to when it might be merged? This functionality would be very nice to have. |
@dls314 Yes this is the same PR as that one you referenced. Same functionality. Just need other customizations for my deploy process so i had to create a feature branch for this PR so i could use the master branch for my purposes only. 👍 So look forward to having this PR merged as well |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rts-cwalker
Thank you for your contribution 👍
Just reviewed the code and did some comments about if-check. Please see those.
And you also need to add the explanation of this feature to documentation, otherwise, everyone can not notice this one.
Would be a good place for this around here.
https://github.com/serverless/serverless/blob/master/docs/providers/aws/guide/serverless.yml.md
lib/plugins/aws/lib/naming.js
Outdated
@@ -46,6 +46,10 @@ module.exports = { | |||
|
|||
// Stack | |||
getStackName() { | |||
if (this.provider.serverless.service.provider.stackName && | |||
this.provider.serverless.service.provider.stackName.length > 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you check length? This should set string value, so I think would be good to use _.isString(this.provider.serverless.service.provider.stackName)
instead of this.provider.serverless.service.provider.stackName.length > 0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good call. updated code and pushed changes. Just saw the link to update docs. So not quite ready to merge yet. Let me update docs as well
lib/plugins/aws/lib/naming.js
Outdated
@@ -145,6 +149,10 @@ module.exports = { | |||
|
|||
// API Gateway | |||
getApiGatewayName() { | |||
if (this.provider.serverless.service.provider.apiName && | |||
this.provider.serverless.service.provider.apiName.length > 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
@rts-cwalker |
I think the documentation is not updated until now https://serverless.com/framework/docs/providers/aws/guide/services/ |
add `stackName` and `apiName` to `serveless.yml` example
What did you implement:
I implemented a feature that allows developers to customize their CloudFormation stack name and AWS API Gateway API name if they do not want to use the default of
${stage}-${service-name}
.Closes #2638
How did you implement it:
I added a check to see if certain properties were defined in the YAML, and if so, use it for the stack name or API name. If the properties are not defined, use the default as it has been
How can we verify it:
You will need to replace anything inside
<
and>
in the config belowserverless.yml
Todos:
Is this ready for review?: YES
Is it a breaking change?: NO