https://pulumi.com logo
#azure
Title
# azure
e

enough-oil-63049

04/13/2020, 12:11 PM
This is probably pretty basic but I am stuck on the following Python code:
Copy code
if peer:
            org = props.config.require('org')
            project = get_project()
            peer_stack = StackReference(f'{org}/{project}/{peer}')
            peer_hub_id = peer_stack.get_output('hub_id')
            peer_hub_name = peer_stack.get_output('hub_name')
            # need a reference to the peer hub VNet but the following statement doesn't work
            peer_hub = network.VirtualNetwork.get(peer_hub_name, peer_hub_id)
            peer_fw_ip = peer_hub.hub_fw_ip
            peer_dmz_ar = peer_hub.peer_dmz_ar 
            peer_hub_as = peer_hub.peer_hub_as
I know everything up to the point noted above works, but I need to get a reference to the peer_hub vnet in the other stack. The parameters are:
Copy code
+ peer_hub_id  : "/subscriptions/subscription/resourceGroups/prod-vdc-rg-947d7dbf/providers/Microsoft.Network/virtualNetworks/hub-vn-f428d4f8"
  + peer_hub_name: "hub-vn-f428d4f8"
But when statement:
peer_hub = network.VirtualNetwork.get(peer_hub_name, peer_hub_id)
executes, the result is:
TypeError: Expected resource name to be a string
What am I doing wrong here? Going on API
<https://www.pulumi.com/docs/reference/pkg/azure/network/virtualnetwork/>
t

tall-librarian-49374

04/13/2020, 6:44 PM
You are probably passing an output to the call that expects a string
e

enough-oil-63049

04/13/2020, 9:12 PM
👍
3 Views