google_datastore_index

Describes a composite index for Cloud Datastore.

To get more information about Index, see:

Example Usage - Datastore Index

resource "google_firestore_database" "database" {
  project     = "my-project-name"
  # google_datastore_index resources only support the (default) database.
  # However, google_firestore_index can express any Datastore Mode index
  # and should be preferred in all cases.
  name        = "(default)"
  location_id = "nam5"
  type        = "DATASTORE_MODE"

  delete_protection_state = "DELETE_PROTECTION_DISABLED"
  deletion_policy         = "DELETE"
}

resource "google_datastore_index" "default" {
  kind = "foo"
  properties {
    name = "property_a"
    direction = "ASCENDING"
  }
  properties {
    name = "property_b"
    direction = "ASCENDING"
  }

  depends_on = [google_firestore_database.database]
}

Argument Reference

The following arguments are supported:


The properties block supports:

Attributes Reference

In addition to the arguments listed above, the following computed attributes are exported:

Timeouts

This resource provides the following Timeouts configuration options:

Import

Index can be imported using any of these accepted formats:

In Terraform v1.5.0 and later, use an import block to import Index using one of the formats above. For example:

import {
  id = "projects/{{project}}/indexes/{{index_id}}"
  to = google_datastore_index.default
}

When using the terraform import command, Index can be imported using one of the formats above. For example:

$ terraform import google_datastore_index.default projects/{{project}}/indexes/{{index_id}}
$ terraform import google_datastore_index.default {{project}}/{{index_id}}
$ terraform import google_datastore_index.default {{index_id}}

User Project Overrides

This resource supports User Project Overrides.