pulumi / pulumi-gcp

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

Can not import `gcp.firestore.Field` #1553

Open neelance opened 7 months ago

neelance commented 7 months ago

What happened?

I am trying to import a gcp.firestore.Field into our Pulumi stack. The import fails because the diff shows a superfluous argument field. The field argument however is mandatory and it wouldn't make sense semantically to remove it.

Example

  new gcp.firestore.Field(
    "testCollection",
    {
      database: "(default)",
      collection: "testCollection",
      field: "someField",
      indexConfig: {
        indexes: [
          { queryScope: "COLLECTION", order: "ASCENDING" },
          { queryScope: "COLLECTION_GROUP", order: "ASCENDING" },
        ],
      },
    },
    {
      import:
        "projects/my-project/databases/(default)/collectionGroups/testCollection/fields/someField",
    },
  );

Output of pulumi about

CLI
Version 3.101.1 Go Version go1.21.6 Go Compiler gc

Plugins NAME VERSION nodejs unknown

Host
OS darwin Version 14.2.1 Arch arm64

This project is written in nodejs: executable='/opt/homebrew/bin/node' version='v21.5.0'

Additional context

No response

Contributing

Vote on this issue by adding a 👍 reaction. To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

iwahbe commented 7 months ago

Hi @neelance. I'm sorry your hitting this issue.

As a work-around, is it possible to set field to "" for the import and then set it back to it's correct value afterwards?

neelance commented 7 months ago

This worked for now:

This now shows no pending updates and it did not actually touch the infrastructure.

iwahbe commented 7 months ago

I'm glad you found a workaround.