https://pulumi.com logo
#python
Title
# python
w

witty-dentist-91954

07/13/2021, 4:40 PM
I'm setting up an gke nodeport service and want to add the new node_port to a firewall rule, so the default health check works. I'm trying to get the port like this:
my_nodeport = my_svc.spec.apply(lambda p: p.ports[0]['node_port'])
But this failes with an
KeyError: 'node_port'
in outputs.py. It works, if I first create the NodePort and create the firewall in a second run. I would like to avoid setting a fixed node_port in the service. Is there a way to do that?
w

witty-candle-66007

07/13/2021, 5:24 PM
Try putting the ‘my_svc…apply’ block directly in the firewall rule declaration where you currently reference my_nodeport.