chilly-caravan-8120
10/21/2024, 12:12 PMpulumi up
, but the second time, it wants to delete the subnet I created previously. Here is my try/except block:
try:
print("trying....")
subnet = network.get_subnet(
resource_group_name=resource_group.name,
subnet_name="CS-DEL-subnet-" + pulumi.get_stack(),
virtual_network_name=vnet_name,
)
except:
print("Got to the except")
subnet = network.Subnet(
address_prefix=vnet.apply(get_next_subnet_prefix),
resource_name="CS-DEL-subnet-" + pulumi.get_stack(),
resource_group_name=resource_group.name,
subnet_name="CS-DEL-subnet-" + pulumi.get_stack(),
virtual_network_name=vnet_name,
)
I'm not sure if this is a Pulumi thing I'm doing wrong, or a Python thing I'm doing wrong. Any insight would be fantastic! Don't necessarily need a solution, just direction toward documentation would be great! (Though a solution would not be turned down 🙂 )sparse-gold-10561
10/21/2024, 1:42 PMnetwork.Subnet
resource doesn't get added to the code/state anymore, as its using the get_subnet object.chilly-caravan-8120
10/21/2024, 1:43 PM