depends_on doesnt seem to work here -
Iam creating a deploymenet object (pulumi_kubernetes.apps.v1) from like:
deployment = Deployment(app_name,.....
Setting up a loadbalancer object like :
nlb = Service(app_name,....
When i try to get the exteneded configuration of lb like :
lb = aws.lb.get_load_balancer(name=nlb["load_balancer"]["ingress"]["hostname"].apply(lambda hn: hn.split('-')), opts=pulumi.ResourceOptions(depends_on=[nlb]))
It returns the entire list of loadbalancers as if the name= filter were none. My guess is there is a timing issue where the get_load_balancer is getting executed sooner before the nlb gets created.
If timing is the issue, How do i make sure aws.lb.get_load_balancer gets called after the nlb creation ? [ depends_on seems to have no effect.
else Looking for more Debugging techniques coz theres not much in the error message except : Exception: invocation of awslb/getLoadBalancergetLoadBalancer returned an error: invoking awslb/getLoadBalancergetLoadBalancer: Search returned 50 results, please revise so only one is returned
02/14/2020, 7:57 PM
The way your code is written, the name filter is indeed being read too early. You would need to restructure the code so that aws.lb.get_load_balancer() is being called inside the lambda from nlb["load_balancer"]["ingress"]["hostname"].apply().
02/14/2020, 8:23 PM
tried lambda yesterday, just that i have lot more code going inside the lambda, wish depends_on worked as expected.