Search code examples
amazon-web-servicesamazon-elb

AWS application load balancer listener rule paths


Configuring an application load balancer.

I have 3 separate target groups and about 30 different paths I'd like to filter on.

When filling out path pattern what are the possible values? Given it's called "pattern" gives the impression it can accept regex but validation is preventing this.

Is it possible to match multiple paths to a target group or will I have to create a separate rule for each path?

I realise using an additional level in my paths (ie /group1/path, /group2/path) would simplify this but looking at if there's an easy solution for current architecture I've inherited.


Solution

  • I realise this is 2 months old but I have been looking at this today and I found the existing answer not very useful.

    There doesn't appear to be support for full usage of regex, instead only the * and ? characters are used for regex matching. You can't use any of the characters outside of the supported range as shown below:

    • A-Z, a-z, 0-9
    • _ - . $ / ~ " ' @ : +
    • & (using &)
    • * (matches 0 or more characters)
    • ? (matches exactly 1 character)

    http://docs.aws.amazon.com/cli/latest/reference/elbv2/create-rule.html#options

    From my experience you are forced to create separate rules for each path-pattern if you want to do more complicated matching.


    Edit:

    As part of some new changes to ALBs you can now have 75 100 rules per ALB not including defaults. You can also route by host header which is cool.