-
Notifications
You must be signed in to change notification settings - Fork 58
Use resolved region name in counting length of role name #33
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
Conversation
… in getRoleNameLength
Pull Request Test Coverage Report for Build 127
💛 - Coveralls |
glicht
left a comment
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.
Thanks for the contribution. See the small change suggested in my comments.
src/lib/index.ts
Outdated
| for (const part of name_parts) { | ||
| if (part.Ref) { | ||
| length += part.Ref.length; | ||
| length += this.serverless.service.provider.region.length |
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.
I am concerned with breaking something for someone that has a different ref. Let's use the region only when the ref is AWS::Region.
| length += this.serverless.service.provider.region.length | |
| if (part.Ref === 'AWS::Region') { | |
| length += this.serverless.service.provider.region.length; | |
| } | |
| else { // this is not correct but for maintaining compatibility with previous logic we leave it until we can resolve other ref types | |
| length += part.Ref.length; | |
| } |
|
Thanks @maafk . |
|
@glicht Can you create a new release with these changes in? |
|
@glicht pinging again. The fix is in master, but a release with these changes would be very helpful. Thanks! |
|
@glicht Can you please create a release with these changes in it? I'm also happy to help maintain this repo if that would be helpful. Thanks! |
# [2.1.0](v2.0.2...v2.1.0) (2022-04-12) ### Bug Fixes * change PermissionsBoundary feature to add suport for cloudformation functions ([#70](#70)) ([720dc0f](720dc0f)) * **deps:** updated to latest serverless and making tests work ([d0259c8](d0259c8)) * Function properties schema validation fixed ([#63](#63)) ([1f81264](1f81264)) * Support for Serverless v2.5.0 ([#53](#53)) ([09e56ae](09e56ae)) ### Features * add support to PermissionsBoundary ([d68046e](d68046e)) * Docs: added contributing section ([d9715ba](d9715ba)) * nodejs 12 support ([#32](#32)) ([4dd58a2](4dd58a2)) * schema validation ([abbc8af](abbc8af)) * Support new provider.iam property ([6e20297](6e20297)), closes [#73](#73) * Use resolved region name in counting length of role name ([#33](#33)) ([f9fd677](f9fd677)), closes [#26](#26)
Fixes #26.
Added tests that will fail if the region is not accounted for in getRoleNameLength().