(ElasticLoadBalancingV2): CDK to automatically calculate priority for host-based load balancer rules
- Dominant language
- TypeScript
- Stars
- 12.9k
- Forks
- 4.6k
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 74
Description
### Use Case
When creating a host-based load balancer rule, I really don't care about the rule priority because I rely on exact matches, so I don't want to have to keep track of the priority values and make sure I don't try to set the same value twice or else I'll get an error on deployment. I realize this is a problem with AWS itself (it should really be fixed there so no one would have to do anything custom like today), but other tools like Terraform have solved this problem internally so that the end user doesn't have to care about it. It would be great if CDK did this by default as well, and the user would provide the value if there's an exception to the rule.
Desired behavior:
When creating a load balancer rule like this:
```
ApplicationListenerRule.Builder.create(this, "Listener Rule")
.action(ListenerAction.forward(listOf(defaultTargetGroup)))
.conditions(listOf(ListenerCondition.hostHeaders(listOf(hostName))))
.listener(httpsListener)
.priority(1)
.build()
```
I shouldn't have to add the priority myself as I don't rely on priority matches when using host-based rules.
---
This is a :rocket: Feature Request
Contributor guide
Research direction
Start with the ApplicationListenerRule example in the issue and inspect how ElasticLoadBalancingV2 currently handles rule priorities. Done means host-based rules can omit priority, CDK calculates a usable priority automatically, and an explicitly supplied priority remains supported.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, typescript
- Domain
- cloud, infrastructure
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100