Open dyremeen opened 1 week ago
Hi @dyremeen!
Do you have an official source specifying that it is possible to use the argument field
like this?
Thanks for the response, @ggtisc!
The only specific example I've seen is for the Google Cloud console (https://cloud.google.com/firestore/docs/query-data/indexing), but, I think the API documentation for projects.databases.collectionGroups.fields.patch pretty much confirms the approach.
The intro in the doc mentions the use of the update mask:
... Currently, field updates apply only to single field index configuration. However, calls to FirestoreAdmin.UpdateField should provide a field mask to avoid changing any configuration that the caller isn't aware of. The field mask should be specified as: { paths: "indexConfig" }.
Then, for the parameter field.name
the doc says:
A field path may be a simple field name, e.g. address or a path to fields within mapValue , e.g. address.city, or a special field path. The only valid special field is *, which represents any field.
Possible inconsistency for the field
argument of the google_firestore_field
. According to the user it is possible to create the resource with a value of "*"
through CLI or cloud console, but not in terraform.
Community Note
Terraform Version & Provider Version(s)
Terraform v1.9.5 on darwin_arm64
Affected Resource(s)
google_firestore_field
Terraform Configuration
Debug Output
The following is believed to be the relevant pieces from the debug output.
Expected Behavior
The resource is expected to be created successfully, since it is possible to do this with the gcloud CLI or the Firestore JSON API when including an update mask.
The equivalent gcloud CLI command below succeeds:
Calling the JSON API directly also works. Note the use of
updateMask=indexConfig
From the debug output the only difference seems to be the update mask.
Actual Behavior
Terraform apply fails with an upstream API error:
Steps to reproduce
terraform apply
Important Factoids
No response
References
17163
b/370113410