dherault / serverless-offline

Emulate AWS λ and API Gateway locally when developing your Serverless project
MIT License
5.16k stars 794 forks source link

Extend support for ALB event paths #1734

Open apokryfos opened 10 months ago

apokryfos commented 10 months ago

Feature Request

Support ? wildcards in ALB event path condition.

Sample Code

The following should work:

functions:
  myFunc:
    handler: alb.handler
    events:
      - alb:
          listenerArn: <arn>
          priority: <priority>
          conditions:
            path: /api/v?/*

The above current does not work. Based on https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-listeners.html#path-conditions the ? should work in order to match exactly 1 character

i.e. /api/v1/anything should match /api/v2/anything should match /api/v123/anything should not match /api/v/anything should not match