This message was deleted.
# python
s
This message was deleted.
c
Hi, you can use the ListenerRule resource for that (https://www.pulumi.com/registry/packages/aws/api-docs/alb/listenerrule/) All you need is to get the ARN of your LoadBalancer. Here are some ideas on how you can do this: • Import the ARN from the stack outputs • Hard-code the ARN in the stack configuration (not recommended if the above works)
s
I have the lb arn and the listener arn exported. Thanks for the starting point @chilly-application-64311
But will the rule work if the tg is not already associated with the listener?
c
It will work. This is actually how you associate a TargetGroup with your Listener. In the
actions
property you specify target groups that the requests should be forwarded to.
s
Got it, hopefully it won't do anything with the default action?
c
No, but keep in mind that other rules that you add will have higher priority.
s
Got it
@chilly-application-64311 Hey thanks a lot again for helping out, worked like a charm, after ironing out a few nuances (seems like stack references from a different stack of the same project doesn't work, worked it out with ssm). Thanks a lot!
👍 1