This message was deleted.
# getting-started
s
This message was deleted.
w
The subnet resource has a
RouteTable
property: https://www.pulumi.com/registry/packages/azure-native/api-docs/network/subnet/#routetable_csharp I also believe that the RouteTable resource’s
Routes
property Id subproperty can be set with the subnet ID to create this association. https://www.pulumi.com/registry/packages/azure-native/api-docs/network/routetable/#routes_csharp
b
Hi Mitch,
That's right, but I need to connect an existing Subnet and an existing RouteTable.
Something like this
Copy code
var subnetArgs = new SubnetArgs
            {
                Name = subnet.GetProperty("name").ToString(),
                AddressPrefix = subnet.GetProperty("addressPrefix").ToString(),
                RouteTable = new RouteTableArgs {
                    Id = "RouteTable.Id here"
                }
            };
That wont work for this requirement
w
Are either of these resources managed by pulumi?
b
both are
w
So, you should be able to update the pulumi code for one to reference the other. Or, am I missing some nuance here?
b
It seems like the RouteTable Id can only be set on
initial creation
w
What about adding the subnet Id to the routetable routes declaration?
Maybe I am missing something?
I don't see how a Subnet can be assigned to a RouteTable.
w
From googling around how to do this with ARM templates (the Azure-Native provider is based on the ARM API), I believe that assigning the subnet ID in the
routes
property (https://www.pulumi.com/registry/packages/azure-native/api-docs/network/routetable/#route) will associate it.
b
That associates a Route (NextHop, addressPrefix ...) not a subnet
w
You can use the classic azure provider alongside the azure-native provider and should be able to use https://www.pulumi.com/registry/packages/azure/api-docs/network/subnetroutetableassociation/ to create the association.
b
I was thinking that when I started this thread. I was hoping to do it with Azure-Native. Thank you Mitch.
w
I get that and was of the same mind. But since Azure ARM doesn’t appear to allow modifying the subnet resource after creation, it looks like the classic provider resource needs to be used. That said, I would suggest opening an issue against azure-native requesting an analogous association resource.
b
Open a request with Microsoft or Pulumi ?
w
Pulumi
1