1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. firestore
  5. Index
Google Cloud Classic v7.18.0 published on Wednesday, Apr 10, 2024 by Pulumi

gcp.firestore.Index

Explore with Pulumi AI

gcp logo
Google Cloud Classic v7.18.0 published on Wednesday, Apr 10, 2024 by Pulumi

    Cloud Firestore indexes enable simple and complex queries against documents in a database. This resource manages composite indexes and not single field indexes.

    To get more information about Index, see:

    Warning: This resource creates a Firestore Index on a project that already has a Firestore database. If you haven’t already created it, you may create a gcp.firestore.Database resource and location_id set to your chosen location. If you wish to use App Engine, you may instead create a gcp.appengine.Application resource with database_type set to "CLOUD_FIRESTORE". Your Firestore location will be the same as the App Engine location specified.

    Example Usage

    Firestore Index Basic

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const database = new gcp.firestore.Database("database", {
        project: "my-project-name",
        name: "database-id",
        locationId: "nam5",
        type: "FIRESTORE_NATIVE",
        deleteProtectionState: "DELETE_PROTECTION_DISABLED",
        deletionPolicy: "DELETE",
    });
    const my_index = new gcp.firestore.Index("my-index", {
        project: "my-project-name",
        database: database.name,
        collection: "atestcollection",
        fields: [
            {
                fieldPath: "name",
                order: "ASCENDING",
            },
            {
                fieldPath: "description",
                order: "DESCENDING",
            },
        ],
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    database = gcp.firestore.Database("database",
        project="my-project-name",
        name="database-id",
        location_id="nam5",
        type="FIRESTORE_NATIVE",
        delete_protection_state="DELETE_PROTECTION_DISABLED",
        deletion_policy="DELETE")
    my_index = gcp.firestore.Index("my-index",
        project="my-project-name",
        database=database.name,
        collection="atestcollection",
        fields=[
            gcp.firestore.IndexFieldArgs(
                field_path="name",
                order="ASCENDING",
            ),
            gcp.firestore.IndexFieldArgs(
                field_path="description",
                order="DESCENDING",
            ),
        ])
    
    package main
    
    import (
    	"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("database-id"),
    			LocationId:            pulumi.String("nam5"),
    			Type:                  pulumi.String("FIRESTORE_NATIVE"),
    			DeleteProtectionState: pulumi.String("DELETE_PROTECTION_DISABLED"),
    			DeletionPolicy:        pulumi.String("DELETE"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = firestore.NewIndex(ctx, "my-index", &firestore.IndexArgs{
    			Project:    pulumi.String("my-project-name"),
    			Database:   database.Name,
    			Collection: pulumi.String("atestcollection"),
    			Fields: firestore.IndexFieldArray{
    				&firestore.IndexFieldArgs{
    					FieldPath: pulumi.String("name"),
    					Order:     pulumi.String("ASCENDING"),
    				},
    				&firestore.IndexFieldArgs{
    					FieldPath: pulumi.String("description"),
    					Order:     pulumi.String("DESCENDING"),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    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 = "database-id",
            LocationId = "nam5",
            Type = "FIRESTORE_NATIVE",
            DeleteProtectionState = "DELETE_PROTECTION_DISABLED",
            DeletionPolicy = "DELETE",
        });
    
        var my_index = new Gcp.Firestore.Index("my-index", new()
        {
            Project = "my-project-name",
            Database = database.Name,
            Collection = "atestcollection",
            Fields = new[]
            {
                new Gcp.Firestore.Inputs.IndexFieldArgs
                {
                    FieldPath = "name",
                    Order = "ASCENDING",
                },
                new Gcp.Firestore.Inputs.IndexFieldArgs
                {
                    FieldPath = "description",
                    Order = "DESCENDING",
                },
            },
        });
    
    });
    
    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.firestore.Index;
    import com.pulumi.gcp.firestore.IndexArgs;
    import com.pulumi.gcp.firestore.inputs.IndexFieldArgs;
    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("database-id")
                .locationId("nam5")
                .type("FIRESTORE_NATIVE")
                .deleteProtectionState("DELETE_PROTECTION_DISABLED")
                .deletionPolicy("DELETE")
                .build());
    
            var my_index = new Index("my-index", IndexArgs.builder()        
                .project("my-project-name")
                .database(database.name())
                .collection("atestcollection")
                .fields(            
                    IndexFieldArgs.builder()
                        .fieldPath("name")
                        .order("ASCENDING")
                        .build(),
                    IndexFieldArgs.builder()
                        .fieldPath("description")
                        .order("DESCENDING")
                        .build())
                .build());
    
        }
    }
    
    resources:
      database:
        type: gcp:firestore:Database
        properties:
          project: my-project-name
          name: database-id
          locationId: nam5
          type: FIRESTORE_NATIVE
          deleteProtectionState: DELETE_PROTECTION_DISABLED
          deletionPolicy: DELETE
      my-index:
        type: gcp:firestore:Index
        properties:
          project: my-project-name
          database: ${database.name}
          collection: atestcollection
          fields:
            - fieldPath: name
              order: ASCENDING
            - fieldPath: description
              order: DESCENDING
    

    Firestore Index Datastore Mode

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const database = new gcp.firestore.Database("database", {
        project: "my-project-name",
        name: "database-id-dm",
        locationId: "nam5",
        type: "DATASTORE_MODE",
        deleteProtectionState: "DELETE_PROTECTION_DISABLED",
        deletionPolicy: "DELETE",
    });
    const my_index = new gcp.firestore.Index("my-index", {
        project: "my-project-name",
        database: database.name,
        collection: "atestcollection",
        queryScope: "COLLECTION_RECURSIVE",
        apiScope: "DATASTORE_MODE_API",
        fields: [
            {
                fieldPath: "name",
                order: "ASCENDING",
            },
            {
                fieldPath: "description",
                order: "DESCENDING",
            },
        ],
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    database = gcp.firestore.Database("database",
        project="my-project-name",
        name="database-id-dm",
        location_id="nam5",
        type="DATASTORE_MODE",
        delete_protection_state="DELETE_PROTECTION_DISABLED",
        deletion_policy="DELETE")
    my_index = gcp.firestore.Index("my-index",
        project="my-project-name",
        database=database.name,
        collection="atestcollection",
        query_scope="COLLECTION_RECURSIVE",
        api_scope="DATASTORE_MODE_API",
        fields=[
            gcp.firestore.IndexFieldArgs(
                field_path="name",
                order="ASCENDING",
            ),
            gcp.firestore.IndexFieldArgs(
                field_path="description",
                order="DESCENDING",
            ),
        ])
    
    package main
    
    import (
    	"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("database-id-dm"),
    			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 = firestore.NewIndex(ctx, "my-index", &firestore.IndexArgs{
    			Project:    pulumi.String("my-project-name"),
    			Database:   database.Name,
    			Collection: pulumi.String("atestcollection"),
    			QueryScope: pulumi.String("COLLECTION_RECURSIVE"),
    			ApiScope:   pulumi.String("DATASTORE_MODE_API"),
    			Fields: firestore.IndexFieldArray{
    				&firestore.IndexFieldArgs{
    					FieldPath: pulumi.String("name"),
    					Order:     pulumi.String("ASCENDING"),
    				},
    				&firestore.IndexFieldArgs{
    					FieldPath: pulumi.String("description"),
    					Order:     pulumi.String("DESCENDING"),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    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 = "database-id-dm",
            LocationId = "nam5",
            Type = "DATASTORE_MODE",
            DeleteProtectionState = "DELETE_PROTECTION_DISABLED",
            DeletionPolicy = "DELETE",
        });
    
        var my_index = new Gcp.Firestore.Index("my-index", new()
        {
            Project = "my-project-name",
            Database = database.Name,
            Collection = "atestcollection",
            QueryScope = "COLLECTION_RECURSIVE",
            ApiScope = "DATASTORE_MODE_API",
            Fields = new[]
            {
                new Gcp.Firestore.Inputs.IndexFieldArgs
                {
                    FieldPath = "name",
                    Order = "ASCENDING",
                },
                new Gcp.Firestore.Inputs.IndexFieldArgs
                {
                    FieldPath = "description",
                    Order = "DESCENDING",
                },
            },
        });
    
    });
    
    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.firestore.Index;
    import com.pulumi.gcp.firestore.IndexArgs;
    import com.pulumi.gcp.firestore.inputs.IndexFieldArgs;
    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("database-id-dm")
                .locationId("nam5")
                .type("DATASTORE_MODE")
                .deleteProtectionState("DELETE_PROTECTION_DISABLED")
                .deletionPolicy("DELETE")
                .build());
    
            var my_index = new Index("my-index", IndexArgs.builder()        
                .project("my-project-name")
                .database(database.name())
                .collection("atestcollection")
                .queryScope("COLLECTION_RECURSIVE")
                .apiScope("DATASTORE_MODE_API")
                .fields(            
                    IndexFieldArgs.builder()
                        .fieldPath("name")
                        .order("ASCENDING")
                        .build(),
                    IndexFieldArgs.builder()
                        .fieldPath("description")
                        .order("DESCENDING")
                        .build())
                .build());
    
        }
    }
    
    resources:
      database:
        type: gcp:firestore:Database
        properties:
          project: my-project-name
          name: database-id-dm
          locationId: nam5
          type: DATASTORE_MODE
          deleteProtectionState: DELETE_PROTECTION_DISABLED
          deletionPolicy: DELETE
      my-index:
        type: gcp:firestore:Index
        properties:
          project: my-project-name
          database: ${database.name}
          collection: atestcollection
          queryScope: COLLECTION_RECURSIVE
          apiScope: DATASTORE_MODE_API
          fields:
            - fieldPath: name
              order: ASCENDING
            - fieldPath: description
              order: DESCENDING
    

    Create Index Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new Index(name: string, args: IndexArgs, opts?: CustomResourceOptions);
    @overload
    def Index(resource_name: str,
              args: IndexArgs,
              opts: Optional[ResourceOptions] = None)
    
    @overload
    def Index(resource_name: str,
              opts: Optional[ResourceOptions] = None,
              collection: Optional[str] = None,
              fields: Optional[Sequence[IndexFieldArgs]] = None,
              api_scope: Optional[str] = None,
              database: Optional[str] = None,
              project: Optional[str] = None,
              query_scope: Optional[str] = None)
    func NewIndex(ctx *Context, name string, args IndexArgs, opts ...ResourceOption) (*Index, error)
    public Index(string name, IndexArgs args, CustomResourceOptions? opts = null)
    public Index(String name, IndexArgs args)
    public Index(String name, IndexArgs args, CustomResourceOptions options)
    
    type: gcp:firestore:Index
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args IndexArgs
    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 IndexArgs
    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 IndexArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args IndexArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args IndexArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Example

    The following reference example uses placeholder values for all input properties.

    var indexResource = new Gcp.Firestore.Index("indexResource", new()
    {
        Collection = "string",
        Fields = new[]
        {
            new Gcp.Firestore.Inputs.IndexFieldArgs
            {
                ArrayConfig = "string",
                FieldPath = "string",
                Order = "string",
            },
        },
        ApiScope = "string",
        Database = "string",
        Project = "string",
        QueryScope = "string",
    });
    
    example, err := firestore.NewIndex(ctx, "indexResource", &firestore.IndexArgs{
    	Collection: pulumi.String("string"),
    	Fields: firestore.IndexFieldArray{
    		&firestore.IndexFieldArgs{
    			ArrayConfig: pulumi.String("string"),
    			FieldPath:   pulumi.String("string"),
    			Order:       pulumi.String("string"),
    		},
    	},
    	ApiScope:   pulumi.String("string"),
    	Database:   pulumi.String("string"),
    	Project:    pulumi.String("string"),
    	QueryScope: pulumi.String("string"),
    })
    
    var indexResource = new Index("indexResource", IndexArgs.builder()        
        .collection("string")
        .fields(IndexFieldArgs.builder()
            .arrayConfig("string")
            .fieldPath("string")
            .order("string")
            .build())
        .apiScope("string")
        .database("string")
        .project("string")
        .queryScope("string")
        .build());
    
    index_resource = gcp.firestore.Index("indexResource",
        collection="string",
        fields=[gcp.firestore.IndexFieldArgs(
            array_config="string",
            field_path="string",
            order="string",
        )],
        api_scope="string",
        database="string",
        project="string",
        query_scope="string")
    
    const indexResource = new gcp.firestore.Index("indexResource", {
        collection: "string",
        fields: [{
            arrayConfig: "string",
            fieldPath: "string",
            order: "string",
        }],
        apiScope: "string",
        database: "string",
        project: "string",
        queryScope: "string",
    });
    
    type: gcp:firestore:Index
    properties:
        apiScope: string
        collection: string
        database: string
        fields:
            - arrayConfig: string
              fieldPath: string
              order: string
        project: string
        queryScope: string
    

    Index 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 Index resource accepts the following input properties:

    Collection string
    The collection being indexed.
    Fields List<IndexField>
    The fields supported by this index. The last field entry is always for the field path __name__. If, on creation, __name__ was not specified as the last field, it will be added automatically with the same direction as that of the last field defined. If the final field in a composite index is not directional, the __name__ will be ordered "ASCENDING" (unless explicitly specified otherwise). Structure is documented below.
    ApiScope string
    The API scope at which a query is run. Default value is ANY_API. Possible values are: ANY_API, DATASTORE_MODE_API.
    Database string
    The Firestore database id. Defaults to "(default)".
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    QueryScope string
    The scope at which a query is run. Default value is COLLECTION. Possible values are: COLLECTION, COLLECTION_GROUP, COLLECTION_RECURSIVE.
    Collection string
    The collection being indexed.
    Fields []IndexFieldArgs
    The fields supported by this index. The last field entry is always for the field path __name__. If, on creation, __name__ was not specified as the last field, it will be added automatically with the same direction as that of the last field defined. If the final field in a composite index is not directional, the __name__ will be ordered "ASCENDING" (unless explicitly specified otherwise). Structure is documented below.
    ApiScope string
    The API scope at which a query is run. Default value is ANY_API. Possible values are: ANY_API, DATASTORE_MODE_API.
    Database string
    The Firestore database id. Defaults to "(default)".
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    QueryScope string
    The scope at which a query is run. Default value is COLLECTION. Possible values are: COLLECTION, COLLECTION_GROUP, COLLECTION_RECURSIVE.
    collection String
    The collection being indexed.
    fields List<IndexField>
    The fields supported by this index. The last field entry is always for the field path __name__. If, on creation, __name__ was not specified as the last field, it will be added automatically with the same direction as that of the last field defined. If the final field in a composite index is not directional, the __name__ will be ordered "ASCENDING" (unless explicitly specified otherwise). Structure is documented below.
    apiScope String
    The API scope at which a query is run. Default value is ANY_API. Possible values are: ANY_API, DATASTORE_MODE_API.
    database String
    The Firestore database id. Defaults to "(default)".
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    queryScope String
    The scope at which a query is run. Default value is COLLECTION. Possible values are: COLLECTION, COLLECTION_GROUP, COLLECTION_RECURSIVE.
    collection string
    The collection being indexed.
    fields IndexField[]
    The fields supported by this index. The last field entry is always for the field path __name__. If, on creation, __name__ was not specified as the last field, it will be added automatically with the same direction as that of the last field defined. If the final field in a composite index is not directional, the __name__ will be ordered "ASCENDING" (unless explicitly specified otherwise). Structure is documented below.
    apiScope string
    The API scope at which a query is run. Default value is ANY_API. Possible values are: ANY_API, DATASTORE_MODE_API.
    database string
    The Firestore database id. Defaults to "(default)".
    project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    queryScope string
    The scope at which a query is run. Default value is COLLECTION. Possible values are: COLLECTION, COLLECTION_GROUP, COLLECTION_RECURSIVE.
    collection str
    The collection being indexed.
    fields Sequence[IndexFieldArgs]
    The fields supported by this index. The last field entry is always for the field path __name__. If, on creation, __name__ was not specified as the last field, it will be added automatically with the same direction as that of the last field defined. If the final field in a composite index is not directional, the __name__ will be ordered "ASCENDING" (unless explicitly specified otherwise). Structure is documented below.
    api_scope str
    The API scope at which a query is run. Default value is ANY_API. Possible values are: ANY_API, DATASTORE_MODE_API.
    database str
    The Firestore database id. Defaults to "(default)".
    project str
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    query_scope str
    The scope at which a query is run. Default value is COLLECTION. Possible values are: COLLECTION, COLLECTION_GROUP, COLLECTION_RECURSIVE.
    collection String
    The collection being indexed.
    fields List<Property Map>
    The fields supported by this index. The last field entry is always for the field path __name__. If, on creation, __name__ was not specified as the last field, it will be added automatically with the same direction as that of the last field defined. If the final field in a composite index is not directional, the __name__ will be ordered "ASCENDING" (unless explicitly specified otherwise). Structure is documented below.
    apiScope String
    The API scope at which a query is run. Default value is ANY_API. Possible values are: ANY_API, DATASTORE_MODE_API.
    database String
    The Firestore database id. Defaults to "(default)".
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    queryScope String
    The scope at which a query is run. Default value is COLLECTION. Possible values are: COLLECTION, COLLECTION_GROUP, COLLECTION_RECURSIVE.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    A server defined name for this index. Format: projects/{{project}}/databases/{{database}}/collectionGroups/{{collection}}/indexes/{{server_generated_id}}
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    A server defined name for this index. Format: projects/{{project}}/databases/{{database}}/collectionGroups/{{collection}}/indexes/{{server_generated_id}}
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    A server defined name for this index. Format: projects/{{project}}/databases/{{database}}/collectionGroups/{{collection}}/indexes/{{server_generated_id}}
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    A server defined name for this index. Format: projects/{{project}}/databases/{{database}}/collectionGroups/{{collection}}/indexes/{{server_generated_id}}
    id str
    The provider-assigned unique ID for this managed resource.
    name str
    A server defined name for this index. Format: projects/{{project}}/databases/{{database}}/collectionGroups/{{collection}}/indexes/{{server_generated_id}}
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    A server defined name for this index. Format: projects/{{project}}/databases/{{database}}/collectionGroups/{{collection}}/indexes/{{server_generated_id}}

    Look up Existing Index Resource

    Get an existing Index 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?: IndexState, opts?: CustomResourceOptions): Index
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            api_scope: Optional[str] = None,
            collection: Optional[str] = None,
            database: Optional[str] = None,
            fields: Optional[Sequence[IndexFieldArgs]] = None,
            name: Optional[str] = None,
            project: Optional[str] = None,
            query_scope: Optional[str] = None) -> Index
    func GetIndex(ctx *Context, name string, id IDInput, state *IndexState, opts ...ResourceOption) (*Index, error)
    public static Index Get(string name, Input<string> id, IndexState? state, CustomResourceOptions? opts = null)
    public static Index get(String name, Output<String> id, IndexState 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:
    ApiScope string
    The API scope at which a query is run. Default value is ANY_API. Possible values are: ANY_API, DATASTORE_MODE_API.
    Collection string
    The collection being indexed.
    Database string
    The Firestore database id. Defaults to "(default)".
    Fields List<IndexField>
    The fields supported by this index. The last field entry is always for the field path __name__. If, on creation, __name__ was not specified as the last field, it will be added automatically with the same direction as that of the last field defined. If the final field in a composite index is not directional, the __name__ will be ordered "ASCENDING" (unless explicitly specified otherwise). Structure is documented below.
    Name string
    A server defined name for this index. Format: projects/{{project}}/databases/{{database}}/collectionGroups/{{collection}}/indexes/{{server_generated_id}}
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    QueryScope string
    The scope at which a query is run. Default value is COLLECTION. Possible values are: COLLECTION, COLLECTION_GROUP, COLLECTION_RECURSIVE.
    ApiScope string
    The API scope at which a query is run. Default value is ANY_API. Possible values are: ANY_API, DATASTORE_MODE_API.
    Collection string
    The collection being indexed.
    Database string
    The Firestore database id. Defaults to "(default)".
    Fields []IndexFieldArgs
    The fields supported by this index. The last field entry is always for the field path __name__. If, on creation, __name__ was not specified as the last field, it will be added automatically with the same direction as that of the last field defined. If the final field in a composite index is not directional, the __name__ will be ordered "ASCENDING" (unless explicitly specified otherwise). Structure is documented below.
    Name string
    A server defined name for this index. Format: projects/{{project}}/databases/{{database}}/collectionGroups/{{collection}}/indexes/{{server_generated_id}}
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    QueryScope string
    The scope at which a query is run. Default value is COLLECTION. Possible values are: COLLECTION, COLLECTION_GROUP, COLLECTION_RECURSIVE.
    apiScope String
    The API scope at which a query is run. Default value is ANY_API. Possible values are: ANY_API, DATASTORE_MODE_API.
    collection String
    The collection being indexed.
    database String
    The Firestore database id. Defaults to "(default)".
    fields List<IndexField>
    The fields supported by this index. The last field entry is always for the field path __name__. If, on creation, __name__ was not specified as the last field, it will be added automatically with the same direction as that of the last field defined. If the final field in a composite index is not directional, the __name__ will be ordered "ASCENDING" (unless explicitly specified otherwise). Structure is documented below.
    name String
    A server defined name for this index. Format: projects/{{project}}/databases/{{database}}/collectionGroups/{{collection}}/indexes/{{server_generated_id}}
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    queryScope String
    The scope at which a query is run. Default value is COLLECTION. Possible values are: COLLECTION, COLLECTION_GROUP, COLLECTION_RECURSIVE.
    apiScope string
    The API scope at which a query is run. Default value is ANY_API. Possible values are: ANY_API, DATASTORE_MODE_API.
    collection string
    The collection being indexed.
    database string
    The Firestore database id. Defaults to "(default)".
    fields IndexField[]
    The fields supported by this index. The last field entry is always for the field path __name__. If, on creation, __name__ was not specified as the last field, it will be added automatically with the same direction as that of the last field defined. If the final field in a composite index is not directional, the __name__ will be ordered "ASCENDING" (unless explicitly specified otherwise). Structure is documented below.
    name string
    A server defined name for this index. Format: projects/{{project}}/databases/{{database}}/collectionGroups/{{collection}}/indexes/{{server_generated_id}}
    project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    queryScope string
    The scope at which a query is run. Default value is COLLECTION. Possible values are: COLLECTION, COLLECTION_GROUP, COLLECTION_RECURSIVE.
    api_scope str
    The API scope at which a query is run. Default value is ANY_API. Possible values are: ANY_API, DATASTORE_MODE_API.
    collection str
    The collection being indexed.
    database str
    The Firestore database id. Defaults to "(default)".
    fields Sequence[IndexFieldArgs]
    The fields supported by this index. The last field entry is always for the field path __name__. If, on creation, __name__ was not specified as the last field, it will be added automatically with the same direction as that of the last field defined. If the final field in a composite index is not directional, the __name__ will be ordered "ASCENDING" (unless explicitly specified otherwise). Structure is documented below.
    name str
    A server defined name for this index. Format: projects/{{project}}/databases/{{database}}/collectionGroups/{{collection}}/indexes/{{server_generated_id}}
    project str
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    query_scope str
    The scope at which a query is run. Default value is COLLECTION. Possible values are: COLLECTION, COLLECTION_GROUP, COLLECTION_RECURSIVE.
    apiScope String
    The API scope at which a query is run. Default value is ANY_API. Possible values are: ANY_API, DATASTORE_MODE_API.
    collection String
    The collection being indexed.
    database String
    The Firestore database id. Defaults to "(default)".
    fields List<Property Map>
    The fields supported by this index. The last field entry is always for the field path __name__. If, on creation, __name__ was not specified as the last field, it will be added automatically with the same direction as that of the last field defined. If the final field in a composite index is not directional, the __name__ will be ordered "ASCENDING" (unless explicitly specified otherwise). Structure is documented below.
    name String
    A server defined name for this index. Format: projects/{{project}}/databases/{{database}}/collectionGroups/{{collection}}/indexes/{{server_generated_id}}
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    queryScope String
    The scope at which a query is run. Default value is COLLECTION. Possible values are: COLLECTION, COLLECTION_GROUP, COLLECTION_RECURSIVE.

    Supporting Types

    IndexField, IndexFieldArgs

    ArrayConfig string
    Indicates that this field supports operations on arrayValues. Only one of order and arrayConfig can be specified. Possible values are: CONTAINS.


    FieldPath string
    Name of the field.
    Order string
    Indicates that this field supports ordering by the specified order or comparing using =, <, <=, >, >=. Only one of order and arrayConfig can be specified. Possible values are: ASCENDING, DESCENDING.
    ArrayConfig string
    Indicates that this field supports operations on arrayValues. Only one of order and arrayConfig can be specified. Possible values are: CONTAINS.


    FieldPath string
    Name of the field.
    Order string
    Indicates that this field supports ordering by the specified order or comparing using =, <, <=, >, >=. Only one of order and arrayConfig can be specified. Possible values are: ASCENDING, DESCENDING.
    arrayConfig String
    Indicates that this field supports operations on arrayValues. Only one of order and arrayConfig can be specified. Possible values are: CONTAINS.


    fieldPath String
    Name of the field.
    order String
    Indicates that this field supports ordering by the specified order or comparing using =, <, <=, >, >=. Only one of order and arrayConfig can be specified. Possible values are: ASCENDING, DESCENDING.
    arrayConfig string
    Indicates that this field supports operations on arrayValues. Only one of order and arrayConfig can be specified. Possible values are: CONTAINS.


    fieldPath string
    Name of the field.
    order string
    Indicates that this field supports ordering by the specified order or comparing using =, <, <=, >, >=. Only one of order and arrayConfig can be specified. Possible values are: ASCENDING, DESCENDING.
    array_config str
    Indicates that this field supports operations on arrayValues. Only one of order and arrayConfig can be specified. Possible values are: CONTAINS.


    field_path str
    Name of the field.
    order str
    Indicates that this field supports ordering by the specified order or comparing using =, <, <=, >, >=. Only one of order and arrayConfig can be specified. Possible values are: ASCENDING, DESCENDING.
    arrayConfig String
    Indicates that this field supports operations on arrayValues. Only one of order and arrayConfig can be specified. Possible values are: CONTAINS.


    fieldPath String
    Name of the field.
    order String
    Indicates that this field supports ordering by the specified order or comparing using =, <, <=, >, >=. Only one of order and arrayConfig can be specified. Possible values are: ASCENDING, DESCENDING.

    Import

    Index can be imported using any of these accepted formats:

    • {{name}}

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

    $ pulumi import gcp:firestore/index:Index default {{name}}
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Google Cloud (GCP) Classic pulumi/pulumi-gcp
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the google-beta Terraform Provider.
    gcp logo
    Google Cloud Classic v7.18.0 published on Wednesday, Apr 10, 2024 by Pulumi