Please vote on this issue by adding a š reaction to the original issue to help the community and maintainers prioritize this request
Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
If you are interested in working on this issue or have submitted a pull request, please leave a comment. If the issue is assigned to the "modular-magician" user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If the issue is assigned to a user, that user is claiming responsibility for the issue. If the issue is assigned to "hashibot", a community member has claimed the issue already.
Description
A Firestore index can take a while to create. For a create index call, the API returns an operation, which the caller poll to wait. Currently, the Firebase CLI doesn't wait on this operation (just succeeds), and the UI surfaces (e.g. Cloud Console, Firebase Console) shows a non-blocking in-progress state in the UI. However, Terraform blocks on the index creation due to polling the returned operation, which makes terraform apply much slower (4 minutes per index for me on an empty database).
New or Affected Resource(s)
google_firestore_index
Potential Terraform Configuration
It's ok to CRUD Firestore documents as normal when the index is being built, so I can't see why we need to wait for the index to be fully built. This is probably why none of the other surfaces (CLI, Console) blocks anything on index creation. For backward compatibility, I suggest a skip_wait field to the Terraform resource that doesn't wait on the returned operation, and maybe make it the default behavior in a major release.
# Propose what you think the configuration to take advantage of this feature should look like.
# We may not use it verbatim, but it's helpful in understanding your intent.
resource "google_firestore_index" "my-index" {
project = "my-project-name"
...
skip_wait = true
}
References
skip_wait may also circumvent the problem experienced in #11316 because the permission "datastore.operations.get" is no longer necessary.
Community Note
Description
A Firestore index can take a while to create. For a create index call, the API returns an operation, which the caller poll to wait. Currently, the Firebase CLI doesn't wait on this operation (just succeeds), and the UI surfaces (e.g. Cloud Console, Firebase Console) shows a non-blocking in-progress state in the UI. However, Terraform blocks on the index creation due to polling the returned operation, which makes
terraform apply
much slower (4 minutes per index for me on an empty database).New or Affected Resource(s)
Potential Terraform Configuration
It's ok to CRUD Firestore documents as normal when the index is being built, so I can't see why we need to wait for the index to be fully built. This is probably why none of the other surfaces (CLI, Console) blocks anything on index creation. For backward compatibility, I suggest a
skip_wait
field to the Terraform resource that doesn't wait on the returned operation, and maybe make it the default behavior in a major release.References
skip_wait
may also circumvent the problem experienced in #11316 because the permission "datastore.operations.get" is no longer necessary.b/275100809