[elasticloadbalancingv2] Support References or CfnParameters in priority
See original GitHub issueIt would be great to be able to set the value of the priority dynamically using a Reference :
ApplicationListenerRule.Builder.create(stack, "ApplicationListenerRule")
.priority(token) // token.getValueAsNumber() does't work
// since it generates a random number ( out of [0,50000] ) at synthesize stage
.build();
-
Actually I want to deploy the same ressoures defined in a stack in new stacks by setting the generated template in the service catalog ( there is a CFN parameter that will be used for the path but it’s not important ). Theses stacks uses the same ALB ( of another Stack ), and creates a new ALB Rule for the new ressources.
I’m trying to recode this with CDK/java ( assuming I have a Lambda that generates the priority ) but it’s seems to be impossible
AllocateAlbRulePriorityCustomResource:
Type: Custom::AllocateAlbRulePriority
[...]
ListenerRule:
Type: AWS::ElasticLoadBalancingV2::ListenerRule
Properties:
Priority: !GetAtt AllocateAlbRulePriorityCustomResource.Priority
[...]
- Another use case is to set that priority as a
CfnParameter
, but when we callgetValueAsNumber()
it will generate a random number probably out of the allowed ranges.
Proposed solution
- Add a new
priority
setter accepting Reference as argument. - or/and Remove the check on priorityValue.
I vote for option 1.
This is a 🚀 Feature Request
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:5 (1 by maintainers)
Top Results From Across the Web
aws-cdk/aws-elasticloadbalancingv2 module
If both are specified, both conditions must be met for the requests to be routed to the given target. priority is a required...
Read more >@aws-cdk/aws-elasticloadbalancingv2 - Package Manager
Fast, reliable, and secure dependency management.
Read more >ElasticLoadBalancingv2 — Boto3 Docs 1.26.36 documentation
This reference covers the following load balancer types: Application Load Balancer - Operates at the application layer (layer 7) and supports HTTP and...
Read more >Error ListenerRule with identifier Priority 10 is currently in use ...
I figured out I could use 4 when I attempted to create an ECS service on the AWS web console, attached to the...
Read more >Find the first available priority number in an ELB ListenerRule ...
AWS::ElasticLoadBalancingV2::ListenerRule requires a priority. We're using specific, targeted hostname rules, so priority doesn't matter, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thank you for sharing @garrettux! That worked for me as well. Here’s my solution with the lambda code as well: https://gist.github.com/AlJohri/fa18bf58b338888934a140c8b6214fdd
Would love any comments if there’s a cleaner way to go about things.
FWIW I was having the same issue and was able to work around it with an escape hatch: