1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. firestore
  5. Field
Google Cloud v8.14.0 published on Wednesday, Jan 15, 2025 by Pulumi

gcp.firestore.Field

Explore with Pulumi AI

Represents a single field in the database. Fields are grouped by their “Collection Group”, which represent all collections in the database with the same id.

To get more information about Field, see:

Warning: This resource creates a Firestore Single Field override on a project that already has a Firestore database. If you haven’t already created it, you may create a gcp.firestore.Database resource with location_id set to your chosen location.

Example Usage

Firestore Field 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_ENABLED",
    deletionPolicy: "DELETE",
});
const basic = new gcp.firestore.Field("basic", {
    project: "my-project-name",
    database: database.name,
    collection: "chatrooms__8493",
    field: "basic",
    indexConfig: {
        indexes: [
            {
                order: "ASCENDING",
                queryScope: "COLLECTION_GROUP",
            },
            {
                arrayConfig: "CONTAINS",
            },
        ],
    },
});
Copy
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_ENABLED",
    deletion_policy="DELETE")
basic = gcp.firestore.Field("basic",
    project="my-project-name",
    database=database.name,
    collection="chatrooms__8493",
    field="basic",
    index_config={
        "indexes": [
            {
                "order": "ASCENDING",
                "query_scope": "COLLECTION_GROUP",
            },
            {
                "array_config": "CONTAINS",
            },
        ],
    })
Copy
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v8/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_ENABLED"),
			DeletionPolicy:        pulumi.String("DELETE"),
		})
		if err != nil {
			return err
		}
		_, err = firestore.NewField(ctx, "basic", &firestore.FieldArgs{
			Project:    pulumi.String("my-project-name"),
			Database:   database.Name,
			Collection: pulumi.String("chatrooms__8493"),
			Field:      pulumi.String("basic"),
			IndexConfig: &firestore.FieldIndexConfigArgs{
				Indexes: firestore.FieldIndexConfigIndexArray{
					&firestore.FieldIndexConfigIndexArgs{
						Order:      pulumi.String("ASCENDING"),
						QueryScope: pulumi.String("COLLECTION_GROUP"),
					},
					&firestore.FieldIndexConfigIndexArgs{
						ArrayConfig: pulumi.String("CONTAINS"),
					},
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
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_ENABLED",
        DeletionPolicy = "DELETE",
    });

    var basic = new Gcp.Firestore.Field("basic", new()
    {
        Project = "my-project-name",
        Database = database.Name,
        Collection = "chatrooms__8493",
        FieldId = "basic",
        IndexConfig = new Gcp.Firestore.Inputs.FieldIndexConfigArgs
        {
            Indexes = new[]
            {
                new Gcp.Firestore.Inputs.FieldIndexConfigIndexArgs
                {
                    Order = "ASCENDING",
                    QueryScope = "COLLECTION_GROUP",
                },
                new Gcp.Firestore.Inputs.FieldIndexConfigIndexArgs
                {
                    ArrayConfig = "CONTAINS",
                },
            },
        },
    });

});
Copy
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.Field;
import com.pulumi.gcp.firestore.FieldArgs;
import com.pulumi.gcp.firestore.inputs.FieldIndexConfigArgs;
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_ENABLED")
            .deletionPolicy("DELETE")
            .build());

        var basic = new Field("basic", FieldArgs.builder()
            .project("my-project-name")
            .database(database.name())
            .collection("chatrooms__8493")
            .field("basic")
            .indexConfig(FieldIndexConfigArgs.builder()
                .indexes(                
                    FieldIndexConfigIndexArgs.builder()
                        .order("ASCENDING")
                        .queryScope("COLLECTION_GROUP")
                        .build(),
                    FieldIndexConfigIndexArgs.builder()
                        .arrayConfig("CONTAINS")
                        .build())
                .build())
            .build());

    }
}
Copy
resources:
  database:
    type: gcp:firestore:Database
    properties:
      project: my-project-name
      name: database-id
      locationId: nam5
      type: FIRESTORE_NATIVE
      deleteProtectionState: DELETE_PROTECTION_ENABLED
      deletionPolicy: DELETE
  basic:
    type: gcp:firestore:Field
    properties:
      project: my-project-name
      database: ${database.name}
      collection: chatrooms__8493
      field: basic
      indexConfig:
        indexes:
          - order: ASCENDING
            queryScope: COLLECTION_GROUP
          - arrayConfig: CONTAINS
Copy

Firestore Field Timestamp

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_ENABLED",
    deletionPolicy: "DELETE",
});
const timestamp = new gcp.firestore.Field("timestamp", {
    project: "my-project-name",
    database: database.name,
    collection: "chatrooms",
    field: "timestamp",
    ttlConfig: {},
    indexConfig: {},
});
Copy
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_ENABLED",
    deletion_policy="DELETE")
timestamp = gcp.firestore.Field("timestamp",
    project="my-project-name",
    database=database.name,
    collection="chatrooms",
    field="timestamp",
    ttl_config={},
    index_config={})
Copy
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v8/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_ENABLED"),
			DeletionPolicy:        pulumi.String("DELETE"),
		})
		if err != nil {
			return err
		}
		_, err = firestore.NewField(ctx, "timestamp", &firestore.FieldArgs{
			Project:     pulumi.String("my-project-name"),
			Database:    database.Name,
			Collection:  pulumi.String("chatrooms"),
			Field:       pulumi.String("timestamp"),
			TtlConfig:   &firestore.FieldTtlConfigArgs{},
			IndexConfig: &firestore.FieldIndexConfigArgs{},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
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_ENABLED",
        DeletionPolicy = "DELETE",
    });

    var timestamp = new Gcp.Firestore.Field("timestamp", new()
    {
        Project = "my-project-name",
        Database = database.Name,
        Collection = "chatrooms",
        FieldId = "timestamp",
        TtlConfig = null,
        IndexConfig = null,
    });

});
Copy
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.Field;
import com.pulumi.gcp.firestore.FieldArgs;
import com.pulumi.gcp.firestore.inputs.FieldTtlConfigArgs;
import com.pulumi.gcp.firestore.inputs.FieldIndexConfigArgs;
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_ENABLED")
            .deletionPolicy("DELETE")
            .build());

        var timestamp = new Field("timestamp", FieldArgs.builder()
            .project("my-project-name")
            .database(database.name())
            .collection("chatrooms")
            .field("timestamp")
            .ttlConfig()
            .indexConfig()
            .build());

    }
}
Copy
resources:
  database:
    type: gcp:firestore:Database
    properties:
      project: my-project-name
      name: database-id
      locationId: nam5
      type: FIRESTORE_NATIVE
      deleteProtectionState: DELETE_PROTECTION_ENABLED
      deletionPolicy: DELETE
  timestamp:
    type: gcp:firestore:Field
    properties:
      project: my-project-name
      database: ${database.name}
      collection: chatrooms
      field: timestamp
      ttlConfig: {}
      indexConfig: {}
Copy

Firestore Field Match Override

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_ENABLED",
    deletionPolicy: "DELETE",
});
const matchOverride = new gcp.firestore.Field("match_override", {
    project: "my-project-name",
    database: database.name,
    collection: "chatrooms__9106",
    field: "field_with_same_configuration_as_ancestor",
    indexConfig: {
        indexes: [
            {
                order: "ASCENDING",
            },
            {
                order: "DESCENDING",
            },
            {
                arrayConfig: "CONTAINS",
            },
        ],
    },
});
Copy
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_ENABLED",
    deletion_policy="DELETE")
match_override = gcp.firestore.Field("match_override",
    project="my-project-name",
    database=database.name,
    collection="chatrooms__9106",
    field="field_with_same_configuration_as_ancestor",
    index_config={
        "indexes": [
            {
                "order": "ASCENDING",
            },
            {
                "order": "DESCENDING",
            },
            {
                "array_config": "CONTAINS",
            },
        ],
    })
Copy
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v8/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_ENABLED"),
			DeletionPolicy:        pulumi.String("DELETE"),
		})
		if err != nil {
			return err
		}
		_, err = firestore.NewField(ctx, "match_override", &firestore.FieldArgs{
			Project:    pulumi.String("my-project-name"),
			Database:   database.Name,
			Collection: pulumi.String("chatrooms__9106"),
			Field:      pulumi.String("field_with_same_configuration_as_ancestor"),
			IndexConfig: &firestore.FieldIndexConfigArgs{
				Indexes: firestore.FieldIndexConfigIndexArray{
					&firestore.FieldIndexConfigIndexArgs{
						Order: pulumi.String("ASCENDING"),
					},
					&firestore.FieldIndexConfigIndexArgs{
						Order: pulumi.String("DESCENDING"),
					},
					&firestore.FieldIndexConfigIndexArgs{
						ArrayConfig: pulumi.String("CONTAINS"),
					},
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
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_ENABLED",
        DeletionPolicy = "DELETE",
    });

    var matchOverride = new Gcp.Firestore.Field("match_override", new()
    {
        Project = "my-project-name",
        Database = database.Name,
        Collection = "chatrooms__9106",
        FieldId = "field_with_same_configuration_as_ancestor",
        IndexConfig = new Gcp.Firestore.Inputs.FieldIndexConfigArgs
        {
            Indexes = new[]
            {
                new Gcp.Firestore.Inputs.FieldIndexConfigIndexArgs
                {
                    Order = "ASCENDING",
                },
                new Gcp.Firestore.Inputs.FieldIndexConfigIndexArgs
                {
                    Order = "DESCENDING",
                },
                new Gcp.Firestore.Inputs.FieldIndexConfigIndexArgs
                {
                    ArrayConfig = "CONTAINS",
                },
            },
        },
    });

});
Copy
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.Field;
import com.pulumi.gcp.firestore.FieldArgs;
import com.pulumi.gcp.firestore.inputs.FieldIndexConfigArgs;
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_ENABLED")
            .deletionPolicy("DELETE")
            .build());

        var matchOverride = new Field("matchOverride", FieldArgs.builder()
            .project("my-project-name")
            .database(database.name())
            .collection("chatrooms__9106")
            .field("field_with_same_configuration_as_ancestor")
            .indexConfig(FieldIndexConfigArgs.builder()
                .indexes(                
                    FieldIndexConfigIndexArgs.builder()
                        .order("ASCENDING")
                        .build(),
                    FieldIndexConfigIndexArgs.builder()
                        .order("DESCENDING")
                        .build(),
                    FieldIndexConfigIndexArgs.builder()
                        .arrayConfig("CONTAINS")
                        .build())
                .build())
            .build());

    }
}
Copy
resources:
  database:
    type: gcp:firestore:Database
    properties:
      project: my-project-name
      name: database-id
      locationId: nam5
      type: FIRESTORE_NATIVE
      deleteProtectionState: DELETE_PROTECTION_ENABLED
      deletionPolicy: DELETE
  matchOverride:
    type: gcp:firestore:Field
    name: match_override
    properties:
      project: my-project-name
      database: ${database.name}
      collection: chatrooms__9106
      field: field_with_same_configuration_as_ancestor
      indexConfig:
        indexes:
          - order: ASCENDING
          - order: DESCENDING
          - arrayConfig: CONTAINS
Copy

Create Field Resource

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

Constructor syntax

new Field(name: string, args: FieldArgs, opts?: CustomResourceOptions);
@overload
def Field(resource_name: str,
          args: FieldArgs,
          opts: Optional[ResourceOptions] = None)

@overload
def Field(resource_name: str,
          opts: Optional[ResourceOptions] = None,
          collection: Optional[str] = None,
          field: Optional[str] = None,
          database: Optional[str] = None,
          index_config: Optional[FieldIndexConfigArgs] = None,
          project: Optional[str] = None,
          ttl_config: Optional[FieldTtlConfigArgs] = None)
func NewField(ctx *Context, name string, args FieldArgs, opts ...ResourceOption) (*Field, error)
public Field(string name, FieldArgs args, CustomResourceOptions? opts = null)
public Field(String name, FieldArgs args)
public Field(String name, FieldArgs args, CustomResourceOptions options)
type: gcp:firestore:Field
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

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

Constructor example

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

var fieldResource = new Gcp.Firestore.Field("fieldResource", new()
{
    Collection = "string",
    FieldId = "string",
    Database = "string",
    IndexConfig = new Gcp.Firestore.Inputs.FieldIndexConfigArgs
    {
        Indexes = new[]
        {
            new Gcp.Firestore.Inputs.FieldIndexConfigIndexArgs
            {
                ArrayConfig = "string",
                Order = "string",
                QueryScope = "string",
            },
        },
    },
    Project = "string",
    TtlConfig = new Gcp.Firestore.Inputs.FieldTtlConfigArgs
    {
        State = "string",
    },
});
Copy
example, err := firestore.NewField(ctx, "fieldResource", &firestore.FieldArgs{
	Collection: pulumi.String("string"),
	Field:      pulumi.String("string"),
	Database:   pulumi.String("string"),
	IndexConfig: &firestore.FieldIndexConfigArgs{
		Indexes: firestore.FieldIndexConfigIndexArray{
			&firestore.FieldIndexConfigIndexArgs{
				ArrayConfig: pulumi.String("string"),
				Order:       pulumi.String("string"),
				QueryScope:  pulumi.String("string"),
			},
		},
	},
	Project: pulumi.String("string"),
	TtlConfig: &firestore.FieldTtlConfigArgs{
		State: pulumi.String("string"),
	},
})
Copy
var fieldResource = new Field("fieldResource", FieldArgs.builder()
    .collection("string")
    .field("string")
    .database("string")
    .indexConfig(FieldIndexConfigArgs.builder()
        .indexes(FieldIndexConfigIndexArgs.builder()
            .arrayConfig("string")
            .order("string")
            .queryScope("string")
            .build())
        .build())
    .project("string")
    .ttlConfig(FieldTtlConfigArgs.builder()
        .state("string")
        .build())
    .build());
Copy
field_resource = gcp.firestore.Field("fieldResource",
    collection="string",
    field="string",
    database="string",
    index_config={
        "indexes": [{
            "array_config": "string",
            "order": "string",
            "query_scope": "string",
        }],
    },
    project="string",
    ttl_config={
        "state": "string",
    })
Copy
const fieldResource = new gcp.firestore.Field("fieldResource", {
    collection: "string",
    field: "string",
    database: "string",
    indexConfig: {
        indexes: [{
            arrayConfig: "string",
            order: "string",
            queryScope: "string",
        }],
    },
    project: "string",
    ttlConfig: {
        state: "string",
    },
});
Copy
type: gcp:firestore:Field
properties:
    collection: string
    database: string
    field: string
    indexConfig:
        indexes:
            - arrayConfig: string
              order: string
              queryScope: string
    project: string
    ttlConfig:
        state: string
Copy

Field Resource Properties

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

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The Field resource accepts the following input properties:

Collection
This property is required.
Changes to this property will trigger replacement.
string
The id of the collection group to configure.
FieldId
This property is required.
Changes to this property will trigger replacement.
string
The id of the field to configure.


Database Changes to this property will trigger replacement. string
The Firestore database id. Defaults to "(default)".
IndexConfig FieldIndexConfig
The single field index configuration for this field. Creating an index configuration for this field will override any inherited configuration with the indexes specified. Configuring the index configuration with an empty block disables all indexes on the field. Structure is documented below.
Project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
TtlConfig FieldTtlConfig
The TTL configuration for this Field. If set to an empty block (i.e. ttl_config {}), a TTL policy is configured based on the field. If unset, a TTL policy is not configured (or will be disabled upon updating the resource). Structure is documented below.
Collection
This property is required.
Changes to this property will trigger replacement.
string
The id of the collection group to configure.
Field
This property is required.
Changes to this property will trigger replacement.
string
The id of the field to configure.


Database Changes to this property will trigger replacement. string
The Firestore database id. Defaults to "(default)".
IndexConfig FieldIndexConfigArgs
The single field index configuration for this field. Creating an index configuration for this field will override any inherited configuration with the indexes specified. Configuring the index configuration with an empty block disables all indexes on the field. Structure is documented below.
Project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
TtlConfig FieldTtlConfigArgs
The TTL configuration for this Field. If set to an empty block (i.e. ttl_config {}), a TTL policy is configured based on the field. If unset, a TTL policy is not configured (or will be disabled upon updating the resource). Structure is documented below.
collection
This property is required.
Changes to this property will trigger replacement.
String
The id of the collection group to configure.
field
This property is required.
Changes to this property will trigger replacement.
String
The id of the field to configure.


database Changes to this property will trigger replacement. String
The Firestore database id. Defaults to "(default)".
indexConfig FieldIndexConfig
The single field index configuration for this field. Creating an index configuration for this field will override any inherited configuration with the indexes specified. Configuring the index configuration with an empty block disables all indexes on the field. Structure is documented below.
project Changes to this property will trigger replacement. String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
ttlConfig FieldTtlConfig
The TTL configuration for this Field. If set to an empty block (i.e. ttl_config {}), a TTL policy is configured based on the field. If unset, a TTL policy is not configured (or will be disabled upon updating the resource). Structure is documented below.
collection
This property is required.
Changes to this property will trigger replacement.
string
The id of the collection group to configure.
field
This property is required.
Changes to this property will trigger replacement.
string
The id of the field to configure.


database Changes to this property will trigger replacement. string
The Firestore database id. Defaults to "(default)".
indexConfig FieldIndexConfig
The single field index configuration for this field. Creating an index configuration for this field will override any inherited configuration with the indexes specified. Configuring the index configuration with an empty block disables all indexes on the field. Structure is documented below.
project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
ttlConfig FieldTtlConfig
The TTL configuration for this Field. If set to an empty block (i.e. ttl_config {}), a TTL policy is configured based on the field. If unset, a TTL policy is not configured (or will be disabled upon updating the resource). Structure is documented below.
collection
This property is required.
Changes to this property will trigger replacement.
str
The id of the collection group to configure.
field
This property is required.
Changes to this property will trigger replacement.
str
The id of the field to configure.


database Changes to this property will trigger replacement. str
The Firestore database id. Defaults to "(default)".
index_config FieldIndexConfigArgs
The single field index configuration for this field. Creating an index configuration for this field will override any inherited configuration with the indexes specified. Configuring the index configuration with an empty block disables all indexes on the field. Structure is documented below.
project Changes to this property will trigger replacement. str
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
ttl_config FieldTtlConfigArgs
The TTL configuration for this Field. If set to an empty block (i.e. ttl_config {}), a TTL policy is configured based on the field. If unset, a TTL policy is not configured (or will be disabled upon updating the resource). Structure is documented below.
collection
This property is required.
Changes to this property will trigger replacement.
String
The id of the collection group to configure.
field
This property is required.
Changes to this property will trigger replacement.
String
The id of the field to configure.


database Changes to this property will trigger replacement. String
The Firestore database id. Defaults to "(default)".
indexConfig Property Map
The single field index configuration for this field. Creating an index configuration for this field will override any inherited configuration with the indexes specified. Configuring the index configuration with an empty block disables all indexes on the field. Structure is documented below.
project Changes to this property will trigger replacement. String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
ttlConfig Property Map
The TTL configuration for this Field. If set to an empty block (i.e. ttl_config {}), a TTL policy is configured based on the field. If unset, a TTL policy is not configured (or will be disabled upon updating the resource). Structure is documented below.

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
Name string
The name of this field. Format: projects/{{project}}/databases/{{database}}/collectionGroups/{{collection}}/fields/{{field}}
Id string
The provider-assigned unique ID for this managed resource.
Name string
The name of this field. Format: projects/{{project}}/databases/{{database}}/collectionGroups/{{collection}}/fields/{{field}}
id String
The provider-assigned unique ID for this managed resource.
name String
The name of this field. Format: projects/{{project}}/databases/{{database}}/collectionGroups/{{collection}}/fields/{{field}}
id string
The provider-assigned unique ID for this managed resource.
name string
The name of this field. Format: projects/{{project}}/databases/{{database}}/collectionGroups/{{collection}}/fields/{{field}}
id str
The provider-assigned unique ID for this managed resource.
name str
The name of this field. Format: projects/{{project}}/databases/{{database}}/collectionGroups/{{collection}}/fields/{{field}}
id String
The provider-assigned unique ID for this managed resource.
name String
The name of this field. Format: projects/{{project}}/databases/{{database}}/collectionGroups/{{collection}}/fields/{{field}}

Look up Existing Field Resource

Get an existing Field 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?: FieldState, opts?: CustomResourceOptions): Field
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        collection: Optional[str] = None,
        database: Optional[str] = None,
        field: Optional[str] = None,
        index_config: Optional[FieldIndexConfigArgs] = None,
        name: Optional[str] = None,
        project: Optional[str] = None,
        ttl_config: Optional[FieldTtlConfigArgs] = None) -> Field
func GetField(ctx *Context, name string, id IDInput, state *FieldState, opts ...ResourceOption) (*Field, error)
public static Field Get(string name, Input<string> id, FieldState? state, CustomResourceOptions? opts = null)
public static Field get(String name, Output<String> id, FieldState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
Collection Changes to this property will trigger replacement. string
The id of the collection group to configure.
Database Changes to this property will trigger replacement. string
The Firestore database id. Defaults to "(default)".
FieldId Changes to this property will trigger replacement. string
The id of the field to configure.


IndexConfig FieldIndexConfig
The single field index configuration for this field. Creating an index configuration for this field will override any inherited configuration with the indexes specified. Configuring the index configuration with an empty block disables all indexes on the field. Structure is documented below.
Name string
The name of this field. Format: projects/{{project}}/databases/{{database}}/collectionGroups/{{collection}}/fields/{{field}}
Project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
TtlConfig FieldTtlConfig
The TTL configuration for this Field. If set to an empty block (i.e. ttl_config {}), a TTL policy is configured based on the field. If unset, a TTL policy is not configured (or will be disabled upon updating the resource). Structure is documented below.
Collection Changes to this property will trigger replacement. string
The id of the collection group to configure.
Database Changes to this property will trigger replacement. string
The Firestore database id. Defaults to "(default)".
Field Changes to this property will trigger replacement. string
The id of the field to configure.


IndexConfig FieldIndexConfigArgs
The single field index configuration for this field. Creating an index configuration for this field will override any inherited configuration with the indexes specified. Configuring the index configuration with an empty block disables all indexes on the field. Structure is documented below.
Name string
The name of this field. Format: projects/{{project}}/databases/{{database}}/collectionGroups/{{collection}}/fields/{{field}}
Project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
TtlConfig FieldTtlConfigArgs
The TTL configuration for this Field. If set to an empty block (i.e. ttl_config {}), a TTL policy is configured based on the field. If unset, a TTL policy is not configured (or will be disabled upon updating the resource). Structure is documented below.
collection Changes to this property will trigger replacement. String
The id of the collection group to configure.
database Changes to this property will trigger replacement. String
The Firestore database id. Defaults to "(default)".
field Changes to this property will trigger replacement. String
The id of the field to configure.


indexConfig FieldIndexConfig
The single field index configuration for this field. Creating an index configuration for this field will override any inherited configuration with the indexes specified. Configuring the index configuration with an empty block disables all indexes on the field. Structure is documented below.
name String
The name of this field. Format: projects/{{project}}/databases/{{database}}/collectionGroups/{{collection}}/fields/{{field}}
project Changes to this property will trigger replacement. String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
ttlConfig FieldTtlConfig
The TTL configuration for this Field. If set to an empty block (i.e. ttl_config {}), a TTL policy is configured based on the field. If unset, a TTL policy is not configured (or will be disabled upon updating the resource). Structure is documented below.
collection Changes to this property will trigger replacement. string
The id of the collection group to configure.
database Changes to this property will trigger replacement. string
The Firestore database id. Defaults to "(default)".
field Changes to this property will trigger replacement. string
The id of the field to configure.


indexConfig FieldIndexConfig
The single field index configuration for this field. Creating an index configuration for this field will override any inherited configuration with the indexes specified. Configuring the index configuration with an empty block disables all indexes on the field. Structure is documented below.
name string
The name of this field. Format: projects/{{project}}/databases/{{database}}/collectionGroups/{{collection}}/fields/{{field}}
project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
ttlConfig FieldTtlConfig
The TTL configuration for this Field. If set to an empty block (i.e. ttl_config {}), a TTL policy is configured based on the field. If unset, a TTL policy is not configured (or will be disabled upon updating the resource). Structure is documented below.
collection Changes to this property will trigger replacement. str
The id of the collection group to configure.
database Changes to this property will trigger replacement. str
The Firestore database id. Defaults to "(default)".
field Changes to this property will trigger replacement. str
The id of the field to configure.


index_config FieldIndexConfigArgs
The single field index configuration for this field. Creating an index configuration for this field will override any inherited configuration with the indexes specified. Configuring the index configuration with an empty block disables all indexes on the field. Structure is documented below.
name str
The name of this field. Format: projects/{{project}}/databases/{{database}}/collectionGroups/{{collection}}/fields/{{field}}
project Changes to this property will trigger replacement. str
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
ttl_config FieldTtlConfigArgs
The TTL configuration for this Field. If set to an empty block (i.e. ttl_config {}), a TTL policy is configured based on the field. If unset, a TTL policy is not configured (or will be disabled upon updating the resource). Structure is documented below.
collection Changes to this property will trigger replacement. String
The id of the collection group to configure.
database Changes to this property will trigger replacement. String
The Firestore database id. Defaults to "(default)".
field Changes to this property will trigger replacement. String
The id of the field to configure.


indexConfig Property Map
The single field index configuration for this field. Creating an index configuration for this field will override any inherited configuration with the indexes specified. Configuring the index configuration with an empty block disables all indexes on the field. Structure is documented below.
name String
The name of this field. Format: projects/{{project}}/databases/{{database}}/collectionGroups/{{collection}}/fields/{{field}}
project Changes to this property will trigger replacement. String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
ttlConfig Property Map
The TTL configuration for this Field. If set to an empty block (i.e. ttl_config {}), a TTL policy is configured based on the field. If unset, a TTL policy is not configured (or will be disabled upon updating the resource). Structure is documented below.

Supporting Types

FieldIndexConfig
, FieldIndexConfigArgs

Indexes List<FieldIndexConfigIndex>
The indexes to configure on the field. Order or array contains must be specified. Structure is documented below.
Indexes []FieldIndexConfigIndex
The indexes to configure on the field. Order or array contains must be specified. Structure is documented below.
indexes List<FieldIndexConfigIndex>
The indexes to configure on the field. Order or array contains must be specified. Structure is documented below.
indexes FieldIndexConfigIndex[]
The indexes to configure on the field. Order or array contains must be specified. Structure is documented below.
indexes Sequence[FieldIndexConfigIndex]
The indexes to configure on the field. Order or array contains must be specified. Structure is documented below.
indexes List<Property Map>
The indexes to configure on the field. Order or array contains must be specified. Structure is documented below.

FieldIndexConfigIndex
, FieldIndexConfigIndexArgs

ArrayConfig string
Indicates that this field supports operations on arrayValues. Only one of order and arrayConfig can be specified. Possible values are: CONTAINS.
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.
QueryScope string
The scope at which a query is run. Collection scoped queries require you specify the collection at query time. Collection group scope allows queries across all collections with the same id. Default value is COLLECTION. Possible values are: COLLECTION, COLLECTION_GROUP.
ArrayConfig string
Indicates that this field supports operations on arrayValues. Only one of order and arrayConfig can be specified. Possible values are: CONTAINS.
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.
QueryScope string
The scope at which a query is run. Collection scoped queries require you specify the collection at query time. Collection group scope allows queries across all collections with the same id. Default value is COLLECTION. Possible values are: COLLECTION, COLLECTION_GROUP.
arrayConfig String
Indicates that this field supports operations on arrayValues. Only one of order and arrayConfig can be specified. Possible values are: CONTAINS.
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.
queryScope String
The scope at which a query is run. Collection scoped queries require you specify the collection at query time. Collection group scope allows queries across all collections with the same id. Default value is COLLECTION. Possible values are: COLLECTION, COLLECTION_GROUP.
arrayConfig string
Indicates that this field supports operations on arrayValues. Only one of order and arrayConfig can be specified. Possible values are: CONTAINS.
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.
queryScope string
The scope at which a query is run. Collection scoped queries require you specify the collection at query time. Collection group scope allows queries across all collections with the same id. Default value is COLLECTION. Possible values are: COLLECTION, COLLECTION_GROUP.
array_config str
Indicates that this field supports operations on arrayValues. Only one of order and arrayConfig can be specified. Possible values are: CONTAINS.
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.
query_scope str
The scope at which a query is run. Collection scoped queries require you specify the collection at query time. Collection group scope allows queries across all collections with the same id. Default value is COLLECTION. Possible values are: COLLECTION, COLLECTION_GROUP.
arrayConfig String
Indicates that this field supports operations on arrayValues. Only one of order and arrayConfig can be specified. Possible values are: CONTAINS.
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.
queryScope String
The scope at which a query is run. Collection scoped queries require you specify the collection at query time. Collection group scope allows queries across all collections with the same id. Default value is COLLECTION. Possible values are: COLLECTION, COLLECTION_GROUP.

FieldTtlConfig
, FieldTtlConfigArgs

State string
(Output) The state of TTL (time-to-live) configuration for documents that have this Field set.
State string
(Output) The state of TTL (time-to-live) configuration for documents that have this Field set.
state String
(Output) The state of TTL (time-to-live) configuration for documents that have this Field set.
state string
(Output) The state of TTL (time-to-live) configuration for documents that have this Field set.
state str
(Output) The state of TTL (time-to-live) configuration for documents that have this Field set.
state String
(Output) The state of TTL (time-to-live) configuration for documents that have this Field set.

Import

Field can be imported using any of these accepted formats:

  • {{name}}

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

$ pulumi import gcp:firestore/field:Field default {{name}}
Copy

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.