Google Cloud (GCP) Classic

Pulumi Official
Package maintained by Pulumi
v6.32.0 published on Wednesday, Jul 20, 2022 by Pulumi

DataStoreIndex

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 gcp.appengine.Application resource with database_type set to "CLOUD_DATASTORE_COMPATIBILITY" to do so. Your Datastore location will be the same as the App Engine location specified.

Example Usage

Datastore Index

using Pulumi;
using Gcp = Pulumi.Gcp;

class MyStack : Stack
{
    public MyStack()
    {
        var @default = new Gcp.Datastore.DataStoreIndex("default", new Gcp.Datastore.DataStoreIndexArgs
        {
            Kind = "foo",
            Properties = 
            {
                new Gcp.Datastore.Inputs.DataStoreIndexPropertyArgs
                {
                    Direction = "ASCENDING",
                    Name = "property_a",
                },
                new Gcp.Datastore.Inputs.DataStoreIndexPropertyArgs
                {
                    Direction = "ASCENDING",
                    Name = "property_b",
                },
            },
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v6/go/gcp/datastore"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := datastore.NewDataStoreIndex(ctx, "default", &datastore.DataStoreIndexArgs{
			Kind: pulumi.String("foo"),
			Properties: datastore.DataStoreIndexPropertyArray{
				&datastore.DataStoreIndexPropertyArgs{
					Direction: pulumi.String("ASCENDING"),
					Name:      pulumi.String("property_a"),
				},
				&datastore.DataStoreIndexPropertyArgs{
					Direction: pulumi.String("ASCENDING"),
					Name:      pulumi.String("property_b"),
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var default_ = new DataStoreIndex("default", DataStoreIndexArgs.builder()        
            .kind("foo")
            .properties(            
                DataStoreIndexPropertyArgs.builder()
                    .direction("ASCENDING")
                    .name("property_a")
                    .build(),
                DataStoreIndexPropertyArgs.builder()
                    .direction("ASCENDING")
                    .name("property_b")
                    .build())
            .build());

    }
}
import pulumi
import pulumi_gcp as gcp

default = gcp.datastore.DataStoreIndex("default",
    kind="foo",
    properties=[
        gcp.datastore.DataStoreIndexPropertyArgs(
            direction="ASCENDING",
            name="property_a",
        ),
        gcp.datastore.DataStoreIndexPropertyArgs(
            direction="ASCENDING",
            name="property_b",
        ),
    ])
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const defaultDataStoreIndex = new gcp.datastore.DataStoreIndex("default", {
    kind: "foo",
    properties: [
        {
            direction: "ASCENDING",
            name: "property_a",
        },
        {
            direction: "ASCENDING",
            name: "property_b",
        },
    ],
});
resources:
  default:
    type: gcp:datastore:DataStoreIndex
    properties:
      kind: foo
      properties:
        - direction: ASCENDING
          name: property_a
        - direction: ASCENDING
          name: property_b

Create a DataStoreIndex Resource

new DataStoreIndex(name: string, args: DataStoreIndexArgs, opts?: CustomResourceOptions);
@overload
def DataStoreIndex(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   ancestor: Optional[str] = None,
                   kind: Optional[str] = None,
                   project: Optional[str] = None,
                   properties: Optional[Sequence[DataStoreIndexPropertyArgs]] = None)
@overload
def DataStoreIndex(resource_name: str,
                   args: DataStoreIndexArgs,
                   opts: Optional[ResourceOptions] = None)
func NewDataStoreIndex(ctx *Context, name string, args DataStoreIndexArgs, opts ...ResourceOption) (*DataStoreIndex, error)
public DataStoreIndex(string name, DataStoreIndexArgs args, CustomResourceOptions? opts = null)
public DataStoreIndex(String name, DataStoreIndexArgs args)
public DataStoreIndex(String name, DataStoreIndexArgs args, CustomResourceOptions options)
type: gcp:datastore:DataStoreIndex
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args DataStoreIndexArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args DataStoreIndexArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args DataStoreIndexArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args DataStoreIndexArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args DataStoreIndexArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

DataStoreIndex Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The DataStoreIndex resource accepts the following input properties:

Kind string

The entity kind which the index applies to.

Ancestor string

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

Project string

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

Properties List<DataStoreIndexPropertyArgs>

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

Kind string

The entity kind which the index applies to.

Ancestor string

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

Project string

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

Properties []DataStoreIndexPropertyArgs

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

kind String

The entity kind which the index applies to.

ancestor String

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

project String

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

properties List<DataStoreIndexPropertyArgs>

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

kind string

The entity kind which the index applies to.

ancestor string

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

project string

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

properties DataStoreIndexPropertyArgs[]

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

kind str

The entity kind which the index applies to.

ancestor str

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

project str

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

properties Sequence[DataStoreIndexPropertyArgs]

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

kind String

The entity kind which the index applies to.

ancestor String

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

project String

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

properties List<Property Map>

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

Outputs

All input properties are implicitly available as output properties. Additionally, the DataStoreIndex resource produces the following output properties:

Id string

The provider-assigned unique ID for this managed resource.

IndexId string

The index id.

Id string

The provider-assigned unique ID for this managed resource.

IndexId string

The index id.

id String

The provider-assigned unique ID for this managed resource.

indexId String

The index id.

id string

The provider-assigned unique ID for this managed resource.

indexId string

The index id.

id str

The provider-assigned unique ID for this managed resource.

index_id str

The index id.

id String

The provider-assigned unique ID for this managed resource.

indexId String

The index id.

Look up an Existing DataStoreIndex Resource

Get an existing DataStoreIndex resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: DataStoreIndexState, opts?: CustomResourceOptions): DataStoreIndex
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        ancestor: Optional[str] = None,
        index_id: Optional[str] = None,
        kind: Optional[str] = None,
        project: Optional[str] = None,
        properties: Optional[Sequence[DataStoreIndexPropertyArgs]] = None) -> DataStoreIndex
func GetDataStoreIndex(ctx *Context, name string, id IDInput, state *DataStoreIndexState, opts ...ResourceOption) (*DataStoreIndex, error)
public static DataStoreIndex Get(string name, Input<string> id, DataStoreIndexState? state, CustomResourceOptions? opts = null)
public static DataStoreIndex get(String name, Output<String> id, DataStoreIndexState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
Ancestor string

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

IndexId string

The index id.

Kind string

The entity kind which the index applies to.

Project string

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

Properties List<DataStoreIndexPropertyArgs>

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

Ancestor string

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

IndexId string

The index id.

Kind string

The entity kind which the index applies to.

Project string

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

Properties []DataStoreIndexPropertyArgs

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

ancestor String

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

indexId String

The index id.

kind String

The entity kind which the index applies to.

project String

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

properties List<DataStoreIndexPropertyArgs>

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

ancestor string

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

indexId string

The index id.

kind string

The entity kind which the index applies to.

project string

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

properties DataStoreIndexPropertyArgs[]

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

ancestor str

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

index_id str

The index id.

kind str

The entity kind which the index applies to.

project str

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

properties Sequence[DataStoreIndexPropertyArgs]

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

ancestor String

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

indexId String

The index id.

kind String

The entity kind which the index applies to.

project String

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

properties List<Property Map>

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

Supporting Types

DataStoreIndexProperty

Direction string

The direction the index should optimize for sorting. Possible values are ASCENDING and DESCENDING.

Name string

The property name to index.

Direction string

The direction the index should optimize for sorting. Possible values are ASCENDING and DESCENDING.

Name string

The property name to index.

direction String

The direction the index should optimize for sorting. Possible values are ASCENDING and DESCENDING.

name String

The property name to index.

direction string

The direction the index should optimize for sorting. Possible values are ASCENDING and DESCENDING.

name string

The property name to index.

direction str

The direction the index should optimize for sorting. Possible values are ASCENDING and DESCENDING.

name str

The property name to index.

direction String

The direction the index should optimize for sorting. Possible values are ASCENDING and DESCENDING.

name String

The property name to index.

Import

Index can be imported using any of these accepted formats

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

Package Details

Repository
https://github.com/pulumi/pulumi-gcp
License
Apache-2.0
Notes

This Pulumi package is based on the google-beta Terraform Provider.