https://pulumi.com logo
Title
b

better-shampoo-48884

03/15/2021, 10:27 AM
Just hit on something scary.. I realized that I had a tag in yaml that was set as an int when it should be a string (was set as
ProjectNumber: 141206
but should have " to force it to string.. you'll see why..). So I noticed that it was set incorrectly - and I decided to just fix it by changing it back and applying the tag change..
Updating (newthing):
     Type                                    Name                      Status                  Info
     pulumi:pulumi:Stack                     modularity-newthing       **failed**              1 error
 ~   └─ azure-native:network:VirtualNetwork  VnetName                  **updating failed**     [diff: ~tags]; 1 error

Diagnostics:
  pulumi:pulumi:Stack (modularity-newthing):
    error: update failed

  azure-native:network:VirtualNetwork (VnetName):
    error: Code="InUseSubnetCannotBeDeleted" Message="Subnet xxxx is in use by /subscriptions/yyyy/resourceGroups/rgName/providers/Microsoft.Network/applicationGateways/appgwName/gatewayIPConfigurations/appGatewayIpConfig and cannot be deleted. In order to delete the subnet, delete all the resources within the subnet. See <http://aka.ms/deletesubnet|aka.ms/deletesubnet>." Details=[]
Edit: seems to be an instance of https://github.com/pulumi/pulumi-azure-native/issues/611, setting
ignoreChanges: ['subnets']
on
opts
of the vnet worked well for me.
that is friggin scary.. running a diff shows this:
~ azure-native:network:VirtualNetwork: (update)
        [id=/subscriptions/yyyy/resourceGroups/rgName/providers/Microsoft.Network/virtualNetworks/VnetName]
        [urn=urn:pulumi:newthing::modularity::azure-native:network:VirtualNetwork::VnetName]
        [provider=urn:pulumi:newthing::modularity::pulumi:providers:azure-native::default_0_7_1::aa842b3f-7bf5-4401-b0eb-a65d275ed25d]
      ~ tags: {
          ~ ProjectNumber: 1.412601e+06 => "1412601"
        }
so.. without showing in the diff or the preview in any way - it wants to delete a subnet?!
running a pulumi refresh then another pulumi up --diff shows that in order to update the tag it wants to destroy all my subnets. haven't changed anything but the tag.. regardless, it's scary that
up
attempts to delete things that
preview
doesn't communicate that it plans on doing
The original run:
λ pulumi up -y --suppress-outputs
Previewing update (newthing):
     Type                                             Name                      Plan       Info
     pulumi:pulumi:Stack                                      
 ~   ├─ azure-native:resources:ResourceGroup           (name goes here)         update     [diff: ~tags]
 ~   ├─ azure-native:keyvault:Vault                    (name goes here)         update     [diff: ~tags]
 ~   ├─ azure-native:containerregistry:Registry        (name goes here)         update     [diff: ~tags]
 ~   ├─ azure-native:network:NetworkSecurityGroup      (name goes here)         update     [diff: ~tags]
 ~   ├─ azure-native:network:VirtualNetwork            (name goes here)         update     [diff: ~tags]
 ~   ├─ azure-native:network:NetworkSecurityGroup      (name goes here)         update     [diff: ~tags]
 ~   ├─ azure-native:network:NetworkSecurityGroup      (name goes here)         update     [diff: ~tags]
 ~   ├─ azure-native:compute:DiskEncryptionSet         (name goes here)         update     [diff: ~tags]
 ~   ├─ azure-native:network:ApplicationGateway        (name goes here)         update     [diff: ~tags]
 ~   ├─ azure-native:authorization:RoleAssignment      (name goes here)         update     [diff: ~principalId]
 +   ├─ azure-native:containerservice:ManagedCluster   (name goes here)         create
 +   ├─ azure-native:containerservice:AgentPool        (name goes here)         create
 +   ├─ azure-native:containerservice:AgentPool        (name goes here)         create
 +   └─ azure-native:containerservice:AgentPool        (name goes here)         create
t

tall-librarian-49374

03/15/2021, 1:03 PM
Subnets that are being deleted are not resources, they are properties of vnet, that’s why you don’t see them in preview
b

better-shampoo-48884

03/15/2021, 1:43 PM
right - so ignore changes it is then.