Skip to content

APIGateway Permissions issue (+ possible solution) #159

Closed
@MartinRisk

Description

@MartinRisk

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions