Skip to content

(elasticloadbalancingv2): Allow regex path patterns #36363

@azatoth

Description

@azatoth

Describe the feature

Currently PathPatternListenerCondition will only allow specifying plain values, but according to https://docs.aws.amazon.com/elasticloadbalancing/latest/application/rule-condition-types.html#path-conditions we can specify regex values instead.

Use Case

when using old style values, you often need to specify two different entries, one for the main level, and one for the children, i.e. ListenerCondition.pathPatterns(["/api", "/api/*"])

Using regex, we would be able to reduce it to a single entry, and/or make it more complex: ListenerCondition.regexPathPatterns(["^/api/?.*$"])

Proposed Solution

add a separate regexPathPatterns function for regex values if we want to keep the backward compatibility of the current function. The difference in the CFN is to use the key RegexValues instead of Values.

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

AWS CDK Library version (aws-cdk-lib)

2.231.0

AWS CDK CLI version

2.1033.0

Environment details (OS name and version, etc.)

Ubuntu 24.04.3 LTS

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions