» google_datastore_index

Describes a composite index for Cloud Datastore.

To get more information about Index, see:

» Example Usage - Datastore Index

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

» Argument Reference

The following arguments are supported:

  • kind - (Required) The entity kind which the index applies to.

  • ancestor - (Optional) Policy for including ancestors in the index.

Default value: NONE Possible values are: * NONE * ALL_ANCESTORS

  • properties - (Optional) An ordered list of properties to index on. Structure is documented below.

  • project - (Optional) The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

The properties block supports:

  • name - (Required) The property name to index.

  • direction - (Required) The direction the index should optimize for sorting.

Possible values are: * ASCENDING * DESCENDING

» Attributes Reference

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

  • id - an identifier for the resource with format projects/{{project}}/indexes/{{index_id}}

  • index_id - The index id.

» Timeouts

This resource provides the following Timeouts configuration options:

  • create - Default is 20 minutes.
  • delete - Default is 10 minutes.

» Import

Index can be imported using any of these accepted formats:

$ 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.