aws / aws/aws-cdk

(elasticloadbalancingv2): Allow regex path patterns

Open
#36,363 1 comment 0 reactions 0 assignees View on GitHub
@aws-cdk/aws-elasticloadbalancingv2 effort/medium feature-request p2
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
2d 3h
Merged PRs (30d)
83

Description

### 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

- [x] 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

Contributor guide

Open the contributing guide

Research direction

Start with PathPatternListenerCondition and the existing pathPatterns API in the elasticloadbalancingv2 module. Compare how the current condition emits Values with the CloudFormation RegexValues requirement, then locate the relevant tests and verify that a separate regexPathPatterns API supports regex inputs while preserving the existing behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript
Domain
cloud
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.