Skip to content

AWS Lambda Plugin option awsgateway_compatible can't reproduce path templates to resource property #14836

@TyAssis

Description

@TyAssis

Is there an existing issue for this?

  • I have searched the existing issues

Kong version ($ kong version)

3.10

Current Behavior

Setting option awsgateway_compatible = true I expected to receive the event payload in the lambda function strictly equal from AWS API Gateway and Kong + AWS Lambda Plugin.
Although, Kong creates resource property with literal matching values and AWS API Gateway set it to the defined resource route itself instead.

Using Kong the event resource property is is:

resource: /site/my-site-slug-123

Expected Behavior

But to be fully compatible with AWS API Gateway, the event resource property should be:

resource: /site/{siteSlug}

Steps To Reproduce

  1. Create a simple lambda function to console.log(event)
export const handler = async (event) => {
  console.log(event);
}
  1. Integrate it to AWS API Gateway using a route with path template variables
  2. Call it through API Gateway and confirm event.resource. It should be like resource: /site/{siteSlug}.
  3. Configure a Route + AWS Plugin in Kong using expressions, e.g. http.path ~ "^/sites/(?<siteSlug>[^/]+)" *. (I tested other operators and regex patterns).
  4. Call it using Kong and confirm event.resource. It should be like resource: /site/my-site-slug-123.

* using named capturing groups was the closest I got to have named pathParameters.

Anything else?

No response

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