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

APIGateway Permissions issue (+ possible solution) #159

Closed
MartinRisk opened this issue Apr 29, 2019 · 3 comments · Fixed by #163
Closed

APIGateway Permissions issue (+ possible solution) #159

MartinRisk opened this issue Apr 29, 2019 · 3 comments · Fixed by #163

Comments

@MartinRisk
Copy link
Member

When functions in the serverless template have two functions where one function starts withj the name of another, the permissions are messed up.

For example
function1 :GetDetailsForUser
function2 :GetDetails

Result is that the permissions for GetDetails are set to the function GetDetailsForUser
When I change the order of the functions in my serverless things work ok.

The plugins has the following code in apiGateway.js: 281
const versionName = _.find(_.keys(versions), version => _.startsWith(version, functionName )); const aliasName = _.find(_.keys(aliases), alias => _.startsWith(alias, functionName ));
The problem is the .startsWith.

Problem can be solved by changing the code to

const versionName = _.find(_.keys(versions), version => _.startsWith(version, functionName + 'LambdaVersion)); const aliasName = _.find(_.keys(aliases), alias => _.startsWith(alias, functionName + 'Alias'));

Please update and deploy this fix

Regards,

Martin

@MartinRisk
Copy link
Member Author

Fixed in #162

@Enase
Copy link
Contributor

Enase commented May 9, 2019

PR is not merged yet, It's too early to close issue, I believe

@aleksdikanski aleksdikanski reopened this May 10, 2019
@aleksdikanski
Copy link

Latest PR for this issue contains an error (Misjudged from my side). I'll create a PR for this.

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 a pull request may close this issue.

3 participants