0

I'm trying to figure out how to connect pulumi_azure.compute.LinuxVirtualMachineScaleSet instance to a backend pool of pulumi_azure.network.ApplicationGateway using Python.

Looking at documentation of pulumi_azure.compute.LinuxVirtualMachineScaleSet ( https://www.pulumi.com/docs/reference/pkg/azure/compute/linuxvirtualmachinescaleset ) it seems that the chain of necessary links would be:

  • step 1 - create LinuxVirtualMachineScaleSetNetworkInterfaceIpConfiguration instance with appropriate applicationGatewayBackendAddressPoolIds set
  • step 2 - create LinuxVirtualMachineScaleSetNetworkInterface instance with network interface ip configuration from step 1
  • step 3 - create LinuxVirtualMachineScaleSet with network_interface from step 2

However while this is what documentation says LinuxVirtualMachineScaleSetNetworkInterfaceIpConfiguration and LinuxVirtualMachineScaleSetNetworkInterface are not defined in pulumi_azure.compute (version 3.17.0, newest as of this writing).

Looking at code samples in both documentation and pulumi_azure.compute's source code, the only way to set network_interfaces argument to LinuxVirtualMachineScaleSet is to provide it with a list of dictionaries, e.g.

network_interfaces=[{
    "name": "example",
    "primary": True,
    "ip_configurations": [{
        "name": "internal",
        "primary": True,
        "subnet_id": ....
    }],
    "network_security_group_id": ...
}],

So what would be the correct way to associate scaling set with application gateway's backend pool?

Puchatek
  • 1,477
  • 3
  • 15
  • 33

1 Answers1

0

After looking through source code of pulumi_azure/compute/linux_virtual_machine_scale_set.py I realized that LinuxVirtualMachineScaleSetNetworkInterfaceIpConfiguration etc mentioned in pulumi's documentation are not classes, but plain dictionaries.

ip_configuration field of network_interface argument to scale set constructor accepts optional applicationGatewayBackendAddressPoolIds keyword, which can be used to associate scale set with application gateway's backend pool.

Puchatek
  • 1,477
  • 3
  • 15
  • 33