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

Tests for - fix the case of per-function custom Role #157

Merged
merged 7 commits into from
May 10, 2019

Conversation

Enase
Copy link
Contributor

@Enase Enase commented Apr 23, 2019

duplicate of #145 with tests written for case when function has custom role name.

@Enase
Copy link
Contributor Author

Enase commented May 9, 2019

@HyperBrain I'm not sure about this fix, could you review?

@Enase Enase self-assigned this May 9, 2019
@Enase Enase added this to the 1.7.2 milestone May 9, 2019
@Enase
Copy link
Contributor Author

Enase commented May 9, 2019

Relates to #88 as well

BTW I use this fix in production, it works fine.

@Enase
Copy link
Contributor Author

Enase commented May 10, 2019

@aleksdikanski could u review / approve?

};
const dependencyIndex = _.indexOf(func.DependsOn, 'IamRoleLambdaExecution');
func.DependsOn[dependencyIndex] = roleLogicalId;
if (_.isEqual(func.Properties.Role, { 'Fn::GetAtt': ['IamRoleLambdaExecution', 'Arn' ]})) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest to not use if in this instance but use _.filter to select the right elements. This goes more with the functional approach, e.g.,:
_.forEach(_.filter(functions, func => _.isEqual(func.Properties.Role, { 'Fn::Gett': ... })), func => ...)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

got it

@Enase Enase merged commit e12d157 into serverless-heaven:master May 10, 2019
defnotrobbie pushed a commit to 1stdibs/serverless-aws-alias that referenced this pull request Nov 14, 2022
…role

Tests for - fix the case of per-function custom Role
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants