Closed remko closed 1 year ago
Hmm- there doesn't seem to be an admin-level REST API that makes sense for this. Is this configured under these methods? https://cloud.google.com/datastore/docs/reference/data/rest/v1/projects
I submitted a feature request to pulumi-gcp
at https://github.com/pulumi/pulumi-gcp/issues/1215, where it was mentioned that they are waiting on this particular issue to be resolved before including it.
In response to your query, @rileykarson, AFAICT, the feature isn't configured under any of the methods listed under that link.
It would be a great feature to include though, so hopefully we can figure something out. A newer issue https://github.com/hashicorp/terraform-provider-google/issues/15781 seem to request the feature as well.
Judging by the instructions in https://cloud.google.com/datastore/docs/ttl#gcloud and some manual testing, the resource to configure this for datastore is actually just https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/firestore_field! I manually created a project w/ the default database in datastore mode, and was able to use that resource to configure a TTL policy:
resource "google_firestore_field" "default" {
project = "tf-test-4glueeyzzm" # datastore project
database = "(default)"
collection = "chatrooms"
field = "my_ttl"
ttl_config {}
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Community Note
Description
Datastore supports TTL policies on entities. I want to be able to set these TTL policies in terraform.
A similar feature for Firestore has recently been implemented.
New or Affected Resource(s)
A new resource such as
google_datastore_ttl_policy
Potential Terraform Configuration
References