Skip to content

Conversation

@maafk
Copy link
Contributor

@maafk maafk commented Sep 11, 2019

Fixes #26.

Added tests that will fail if the region is not accounted for in getRoleNameLength().

@coveralls
Copy link

coveralls commented Sep 16, 2019

Pull Request Test Coverage Report for Build 127

  • 3 of 3 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.1%) to 92.925%

Totals Coverage Status
Change from base Build 117: 0.1%
Covered Lines: 351
Relevant Lines: 372

💛 - Coveralls

Copy link
Member

@glicht glicht left a 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
Copy link
Member

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.

Suggested change
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;
}

@maafk maafk requested a review from glicht September 17, 2019 23:13
@glicht
Copy link
Member

glicht commented Sep 22, 2019

Thanks @maafk .

@glicht glicht merged commit f9fd677 into functionalone:master Sep 22, 2019
@maafk
Copy link
Contributor Author

maafk commented Nov 7, 2019

@glicht Can you create a new release with these changes in?

@maafk
Copy link
Contributor Author

maafk commented Nov 26, 2019

@glicht pinging again. The fix is in master, but a release with these changes would be very helpful.

Thanks!

@maafk
Copy link
Contributor Author

maafk commented Dec 9, 2019

@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!

github-actions bot referenced this pull request in andersquist/serverless-iam-roles-per-function Apr 12, 2022
# [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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Lambda role names are not having lambdaRole at the end removed

3 participants