Skip to content

googleDatastoreIndex

Describes a composite index for Cloud Datastore.

To get more information about Index, see:

\~> Warning: This resource creates a Datastore Index on a project that has already enabled a Datastore-compatible database. If you haven't already enabled one, you can create a googleAppEngineApplication resource with databaseType set to "cloudDatastoreCompatibility" to do so. Your Datastore location will be the same as the App Engine location specified.

Example Usage - Datastore Index

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as google from "./.gen/providers/google";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: google.
For a more precise conversion please use the --provider flag in convert.*/
new google.datastoreIndex.DatastoreIndex(this, "default", {
  kind: "foo",
  properties: [
    {
      direction: "ASCENDING",
      name: "property_a",
    },
    {
      direction: "ASCENDING",
      name: "property_b",
    },
  ],
});

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 is none. Possible values are none and allAncestors.

  • 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 and 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/{{indexId}}

  • indexId - The index id.

Timeouts

This resource provides the following Timeouts configuration options:

  • create - Default is 20 minutes.
  • delete - Default is 20 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.