DataStoreIndexArgs

data class DataStoreIndexArgs(val ancestor: Output<String>? = null, val kind: Output<String>? = null, val project: Output<String>? = null, val properties: Output<List<DataStoreIndexPropertyArgs>>? = null) : ConvertibleToJava<DataStoreIndexArgs>

Warning: datastore_index is deprecated and will be removed in a future major release. Use firestore_index instead; this resource is deprecated because it only supports the (default) database. firestore_index supports both Firestore in Datastore Mode and Firestore Native indexes and supports both named and the (default) database. Describes a composite index for Firestore in Datastore Mode. To get more information about Index, see:

Warning: datastore_index is deprecated and will be removed in a future major release. Use firestore_index instead; this resource is deprecated because it only supports the (default) database. This resource creates a Datastore Index on a project that has already enabled a Datastore-compatible database. If you haven't already created it, you may create a gcp.firestore.Database resource with location_id set to your chosen location, and type set to "DATASTORE_MODE". If you wish to use App Engine, you may instead create a gcp.appengine.Application resource with database_type set to "CLOUD_DATASTORE_COMPATIBILITY". Your Datastore location will be the same as the App Engine location specified.

Example Usage

Datastore Index

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const database = new gcp.firestore.Database("database", {
project: "my-project-name",
name: "(default)",
locationId: "nam5",
type: "DATASTORE_MODE",
deleteProtectionState: "DELETE_PROTECTION_DISABLED",
deletionPolicy: "DELETE",
});
const _default = new gcp.datastore.DataStoreIndex("default", {
kind: "foo",
properties: [
{
name: "property_a",
direction: "ASCENDING",
},
{
name: "property_b",
direction: "ASCENDING",
},
],
}, {
dependsOn: [database],
});
import pulumi
import pulumi_gcp as gcp
database = gcp.firestore.Database("database",
project="my-project-name",
name="(default)",
location_id="nam5",
type="DATASTORE_MODE",
delete_protection_state="DELETE_PROTECTION_DISABLED",
deletion_policy="DELETE")
default = gcp.datastore.DataStoreIndex("default",
kind="foo",
properties=[
{
"name": "property_a",
"direction": "ASCENDING",
},
{
"name": "property_b",
"direction": "ASCENDING",
},
],
opts = pulumi.ResourceOptions(depends_on=[database]))
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var database = new Gcp.Firestore.Database("database", new()
{
Project = "my-project-name",
Name = "(default)",
LocationId = "nam5",
Type = "DATASTORE_MODE",
DeleteProtectionState = "DELETE_PROTECTION_DISABLED",
DeletionPolicy = "DELETE",
});
var @default = new Gcp.Datastore.DataStoreIndex("default", new()
{
Kind = "foo",
Properties = new[]
{
new Gcp.Datastore.Inputs.DataStoreIndexPropertyArgs
{
Name = "property_a",
Direction = "ASCENDING",
},
new Gcp.Datastore.Inputs.DataStoreIndexPropertyArgs
{
Name = "property_b",
Direction = "ASCENDING",
},
},
}, new CustomResourceOptions
{
DependsOn =
{
database,
},
});
});
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/datastore"
"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/firestore"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
database, err := firestore.NewDatabase(ctx, "database", &firestore.DatabaseArgs{
Project: pulumi.String("my-project-name"),
Name: pulumi.String("(default)"),
LocationId: pulumi.String("nam5"),
Type: pulumi.String("DATASTORE_MODE"),
DeleteProtectionState: pulumi.String("DELETE_PROTECTION_DISABLED"),
DeletionPolicy: pulumi.String("DELETE"),
})
if err != nil {
return err
}
_, err = datastore.NewDataStoreIndex(ctx, "default", &datastore.DataStoreIndexArgs{
Kind: pulumi.String("foo"),
Properties: datastore.DataStoreIndexPropertyArray{
&datastore.DataStoreIndexPropertyArgs{
Name: pulumi.String("property_a"),
Direction: pulumi.String("ASCENDING"),
},
&datastore.DataStoreIndexPropertyArgs{
Name: pulumi.String("property_b"),
Direction: pulumi.String("ASCENDING"),
},
},
}, pulumi.DependsOn([]pulumi.Resource{
database,
}))
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.firestore.Database;
import com.pulumi.gcp.firestore.DatabaseArgs;
import com.pulumi.gcp.datastore.DataStoreIndex;
import com.pulumi.gcp.datastore.DataStoreIndexArgs;
import com.pulumi.gcp.datastore.inputs.DataStoreIndexPropertyArgs;
import com.pulumi.resources.CustomResourceOptions;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var database = new Database("database", DatabaseArgs.builder()
.project("my-project-name")
.name("(default)")
.locationId("nam5")
.type("DATASTORE_MODE")
.deleteProtectionState("DELETE_PROTECTION_DISABLED")
.deletionPolicy("DELETE")
.build());
var default_ = new DataStoreIndex("default", DataStoreIndexArgs.builder()
.kind("foo")
.properties(
DataStoreIndexPropertyArgs.builder()
.name("property_a")
.direction("ASCENDING")
.build(),
DataStoreIndexPropertyArgs.builder()
.name("property_b")
.direction("ASCENDING")
.build())
.build(), CustomResourceOptions.builder()
.dependsOn(database)
.build());
}
}
resources:
database:
type: gcp:firestore:Database
properties:
project: my-project-name
name: (default)
locationId: nam5
type: DATASTORE_MODE
deleteProtectionState: DELETE_PROTECTION_DISABLED
deletionPolicy: DELETE
default:
type: gcp:datastore:DataStoreIndex
properties:
kind: foo
properties:
- name: property_a
direction: ASCENDING
- name: property_b
direction: ASCENDING
options:
dependson:
- ${database}

Import

Index can be imported using any of these accepted formats:

  • projects/{{project}}/indexes/{{index_id}}

  • {{project}}/{{index_id}}

  • {{index_id}} When using the pulumi import command, Index can be imported using one of the formats above. For example:

$ pulumi import gcp:datastore/dataStoreIndex:DataStoreIndex default projects/{{project}}/indexes/{{index_id}}
$ pulumi import gcp:datastore/dataStoreIndex:DataStoreIndex default {{project}}/{{index_id}}
$ pulumi import gcp:datastore/dataStoreIndex:DataStoreIndex default {{index_id}}

Constructors

Link copied to clipboard
constructor(ancestor: Output<String>? = null, kind: Output<String>? = null, project: Output<String>? = null, properties: Output<List<DataStoreIndexPropertyArgs>>? = null)

Properties

Link copied to clipboard
val ancestor: Output<String>? = null

Policy for including ancestors in the index. Default value is NONE. Possible values are: NONE, ALL_ANCESTORS.

Link copied to clipboard
val kind: Output<String>? = null

The entity kind which the index applies to.

Link copied to clipboard
val project: Output<String>? = null

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

Link copied to clipboard

An ordered list of properties to index on. Structure is documented below.

Functions

Link copied to clipboard
open override fun toJava(): DataStoreIndexArgs