what's the best process to move from subnets neste...
# azure
c
what's the best process to move from subnets nested within a vnet resource to the standalone subnet resource without any disruption? Anybody wrote something down about this?
s
Just one thought off the top of my head, note that I haven’t tested/validated any of this. 🙂 It wouldn’t surprise me for the subnets to be “parented” to the Vnet, which would change when you move to standalone. That change would lead to a resource replacement, which is not what you want. So, I’d get an export of the Pulumi state file and add
aliases
to the new standalone subnet resources to match the URNs as they were when nested in the Vnet. This should help avoid resource replacement, assuming you match all the other properties correctly.
c
ah yes, aliases, good call. Thanks. After reading a bit more on the subnet itself again (haven't touched our network in a long time) I'm now wondering if we should stick with inline defined. https://github.com/pulumi/pulumi-azure-native/issues/611 cc @happy-parrot-60128 Referencing values from the standalone resource in other resources is just easier than from the inline defined subnets.
t
You should be able to import subnets as standalone resources, then remove inline subnets from vnet entirely - and I'd hope this just magically works after our recent fixes
c
okay, so "standalone" subnets are now recommended? I know we used to have problems with them
t
They were very troublesome until https://github.com/pulumi/pulumi-azure-native/issues/611 got fixed - I think now they are first-class
You still can't mix-and-match - either all inline or all standalone (for a given vnet)
c
okay, cool, that makes referencing them a lot easier and we don't have to do lookups within `vnet.subnets`by subnet name
Thanks!
t
Let us know if something doesn't work. It's relatively new - but we had a very large customer migrate and they sound happy since then.
c
Will do, thanks Mikhail. We're just slowly moving things over to azure-native at the moment and cleaning up our infracode