pulumi / pulumi-gcp

A Google Cloud Platform (GCP) Pulumi resource package, providing multi-language access to GCP
Apache License 2.0
178 stars 52 forks source link

Update replacing compute instance doesn't maintain instance group membership #284

Open c2h5oh opened 4 years ago

c2h5oh commented 4 years ago

pulumi v1.10.0 pulumi-gcp v2.2.0

Repro:

  1. create instance and instance group containing that instance
  2. make a change that requires instance to be replaced & apply it

Expected: replacement instance is part of instance group

Actual: replacement instance is not part of instance group

pulumi refresh followed by pulumi up fixes the issue (once you export stack, edit, import to deal with https://github.com/pulumi/pulumi-gcp/issues/273 ...)

const ubuntu1804LTS = gcp.compute.getImage(
    {
        family: "ubuntu-1804-lts",
        project: "gce-uefi-images"
    }
)

const instance = new gcp.compute.Instance(
   `my-instance`,
   {
      name: `my-instance`,
      description: `My Instance
      machineType: `n1-standard-1`,
      bootDisk: {
         autoDelete: true,
         initializeParams: {
            image: ubuntu1804LTS.selfLink
         }
      },
      networkInterfaces: [
         {
            network: my-network,
            subnetwork: my-subnet-cidr
         }
      ],
      zone: zone,
      allowStoppingForUpdate: false,
      deletionProtection: false,
      canIpForward: false,
      tags: [
         `my-tag`
      ],
      metadata: {
         "enable-oslogin": "TRUE"
      }
   },
   {
      ignoreChanges: [
         "bootDisk"
      ],
    }
)

const group = new gcp.compute.InstanceGroup(
   `my-group`,
   {
      name: `my-group`,
      namedPorts: [
         {
            name: "https",
            port: 443,
         }
      ],
      network: my-network,
      zone: zone,
      instances: [
         instance.selfLink
      ]
   }
)
c2h5oh commented 2 years ago

So... 2 years later and some change we got hit with the exact same issue again - Is there anyone even working on this? All bugs I've reported since I've started using Pulumi with GCP are still open..