pulumi / pulumi-google-native

Apache License 2.0
70 stars 18 forks source link

Refreshing Subnet adds fingerprint to inputs #319

Open KaoruDev opened 2 years ago

KaoruDev commented 2 years ago

Hello!

Issue details

When I run pulumi refresh on a stack with a Subnet with a GKE cluster in it, I'm asked to update the outputs with a fingerprint property.

Steps to reproduce

  1. Create google-native stack with a subnet and GKE cluster.
  2. Run pulumi refresh, prompt should ask you to update outputs of subnet with fingerprint
  3. Run pulumi up notice that there will be an update request, the diff explains a new fingerprint as an input.

Expected: Refresh to work and subsequent update to not fail. Actual: Received this error:

  google-native:compute/v1:Subnetwork (gke-subnet):
    error: error sending request: googleapi: Error 400: Invalid value for field 'resource': '{  "name": "gke-subnet-5b6d2f5",  "description": "Subnet Assigned to GKE nodes",  "network": "https:...'. The following field(s) specified in the request cannot be modified: [region], invalid: "https://www.googleapis.com/compute/v1/projects/my-project-1234/regions/us-west1/subnetworks/gke-subnet-5b6d2f5" map[description:Subnet Assigned to GKE nodes enableFlowLogs:true fingerprint:fhZqr9lQZTg= ipCidrRange:10.102.128.0/22 logConfig:map[enable:true metadata:INCLUDE_ALL_METADATA] name:gke-subnet-5b6d2f5 network:https://www.googleapis.com/compute/v1/projects/my-project-1234/global/networks/main-vpc-9fed4d1 privateIpGoogleAccess:true purpose:PRIVATE_RFC_1918 region:us-west1 role:ACTIVE secondaryIpRanges:[map[ipCidrRange:10.102.244.0/22 rangeName:gke-services] map[ipCidrRange:10.102.0.0/17 rangeName:gke-pods]]]

I had to manually remove fingerprint Inputs from the stack json to fix the issue.

danielrbradley commented 2 years ago

Thanks for the report. Yes it sounds like some unexpected behaviour. We'll add this to our backlog to investigate and try to reproduce.

KaoruDev commented 2 years ago

For others who have encountered this, adding fingerprint to ignoreChanges option will work.

desecho commented 1 year ago

I encountered a similar error and I "fixed" it by adding this code:

{ ignoreChanges: ["fingerprint", "privateIpGoogleAccess", "secondaryIpRanges"] }