Azurerm inbound nat rule to add machines

Hi,

In load balancer inbound nat rules I am able to add the availability set but not able to find any variables related to the target virtual machine.

2 Likes

I am stuck at the same point, if you managed to resolve your problem please update your post with the solution.

Use this resource, https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/network_interface_backend_address_pool_association

Hi @movinalot,

I am not sure the network_interface_backend_address_pool_association would work.

Let me explain my scenario: Using the LB and nat rules for SSH connections using :

  • same Frontend IP
  • different nat rules (one for each vm):
    • port 2250 β†’ 22 for vm0
    • port 2251 β†’ 22 for vm1
      etc.

While you can do this in the Azure portal, i don’t see or understand the options to do this in TF

Thanks for you time btw!

Seams like the azurerm_lb_nat_pool(Terraform Registry) is perfect for this !

Is there any progress here? I have the same issue: unable to associate inbound NAT Rule of LB with particular VM inside availability set. There is any options in TF that are similar to Azure portal itself

Terraform azure resource azurerm_lb_nat_rule is missing target virtual machine option, service tag etc

Any ideas or updates?