Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a Firestore Document data source #20967

Open
lgerard-pass opened this issue Jan 20, 2025 · 1 comment
Open

Add a Firestore Document data source #20967

lgerard-pass opened this issue Jan 20, 2025 · 1 comment

Comments

@lgerard-pass
Copy link

lgerard-pass commented Jan 20, 2025

Community Note

  • 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 an issue is assigned to a user, that user is claiming responsibility for the issue.
  • Customers working with a Google Technical Account Manager or Customer Engineer can ask them to reach out internally to expedite investigation and resolution of this issue.

Description

Add the ability to read data from Firestore using a data source. Our use case is as follows :

We would love to be able to share data between Terraform root modules so that one root modules can consume the outputs of another. This process is described in the Terraform official documentation by using resource and data source pairs : https://developer.hashicorp.com/terraform/language/state/remote-state-data#alternative-ways-to-share-data-between-configurations

We would like to implement this using firestore, but for now we only have the google_firestore_document resource which is great for writing data into Firestore. But we don't have an easy way to read from Firestore.

New or Affected Resource(s)

  • google_firestore_document

Potential Terraform Configuration

data "google_firestore_document" "mydoc" {
  project     = "my_project"
  database    = "my_database"
  collection  = "my_collection"
  document_id = "my-doc-id"
}

I guess it should return the same attributes as the google_firestore_document resource but the fields should be an attribute instead of an argument.

References

https://developer.hashicorp.com/terraform/language/state/remote-state-data#alternative-ways-to-share-data-between-configurations

b/391379797

@github-actions github-actions bot added forward/review In review; remove label to forward service/firestore-dataplane labels Jan 20, 2025
@melinath melinath added new-data-source size/s and removed forward/review In review; remove label to forward labels Jan 21, 2025
@melinath melinath added this to the Goals milestone Jan 21, 2025
@Ludovic-Emo-Pyl-Tech
Copy link

@lgerard-pass Funny coincidence—we just discussed this exact need with a colleague 15 minutes ago! 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants