1. Packages
  2. Packages
  3. Google Cloud (GCP) Classic
  4. API Docs
  5. documentai
  6. Schema
Viewing docs for Google Cloud v9.22.0
published on Friday, May 1, 2026 by Pulumi
gcp logo
Viewing docs for Google Cloud v9.22.0
published on Friday, May 1, 2026 by Pulumi

    NextSchema is a collection of SchemaVersions.

    To get more information about Schema, see:

    Example Usage

    Documentai Schema

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const schema = new gcp.documentai.Schema("schema", {
        location: "us",
        displayName: "my-schema",
        labels: {
            env: "test",
        },
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    schema = gcp.documentai.Schema("schema",
        location="us",
        display_name="my-schema",
        labels={
            "env": "test",
        })
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/documentai"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := documentai.NewSchema(ctx, "schema", &documentai.SchemaArgs{
    			Location:    pulumi.String("us"),
    			DisplayName: pulumi.String("my-schema"),
    			Labels: pulumi.StringMap{
    				"env": pulumi.String("test"),
    			},
    		})
    		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 schema = new Gcp.DocumentAi.Schema("schema", new()
        {
            Location = "us",
            DisplayName = "my-schema",
            Labels = 
            {
                { "env", "test" },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcp.documentai.Schema;
    import com.pulumi.gcp.documentai.SchemaArgs;
    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 schema = new Schema("schema", SchemaArgs.builder()
                .location("us")
                .displayName("my-schema")
                .labels(Map.of("env", "test"))
                .build());
    
        }
    }
    
    resources:
      schema:
        type: gcp:documentai:Schema
        properties:
          location: us
          displayName: my-schema
          labels:
            env: test
    

    Create Schema Resource

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

    Constructor syntax

    new Schema(name: string, args: SchemaArgs, opts?: CustomResourceOptions);
    @overload
    def Schema(resource_name: str,
               args: SchemaArgs,
               opts: Optional[ResourceOptions] = None)
    
    @overload
    def Schema(resource_name: str,
               opts: Optional[ResourceOptions] = None,
               location: Optional[str] = None,
               display_name: Optional[str] = None,
               labels: Optional[Mapping[str, str]] = None,
               project: Optional[str] = None)
    func NewSchema(ctx *Context, name string, args SchemaArgs, opts ...ResourceOption) (*Schema, error)
    public Schema(string name, SchemaArgs args, CustomResourceOptions? opts = null)
    public Schema(String name, SchemaArgs args)
    public Schema(String name, SchemaArgs args, CustomResourceOptions options)
    
    type: gcp:documentai:Schema
    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 SchemaArgs
    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 SchemaArgs
    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 SchemaArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args SchemaArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args SchemaArgs
    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 gcpSchemaResource = new Gcp.DocumentAi.Schema("gcpSchemaResource", new()
    {
        Location = "string",
        DisplayName = "string",
        Labels = 
        {
            { "string", "string" },
        },
        Project = "string",
    });
    
    example, err := documentai.NewSchema(ctx, "gcpSchemaResource", &documentai.SchemaArgs{
    	Location:    pulumi.String("string"),
    	DisplayName: pulumi.String("string"),
    	Labels: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    	Project: pulumi.String("string"),
    })
    
    var gcpSchemaResource = new com.pulumi.gcp.documentai.Schema("gcpSchemaResource", com.pulumi.gcp.documentai.SchemaArgs.builder()
        .location("string")
        .displayName("string")
        .labels(Map.of("string", "string"))
        .project("string")
        .build());
    
    gcp_schema_resource = gcp.documentai.Schema("gcpSchemaResource",
        location="string",
        display_name="string",
        labels={
            "string": "string",
        },
        project="string")
    
    const gcpSchemaResource = new gcp.documentai.Schema("gcpSchemaResource", {
        location: "string",
        displayName: "string",
        labels: {
            string: "string",
        },
        project: "string",
    });
    
    type: gcp:documentai:Schema
    properties:
        displayName: string
        labels:
            string: string
        location: string
        project: string
    

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

    Location string
    The location of the resource.
    DisplayName string
    The user-defined name of the Schema.
    Labels Dictionary<string, string>

    The Google Cloud labels for the Schema.

    Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effectiveLabels for all of the labels present on the resource.

    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    Location string
    The location of the resource.
    DisplayName string
    The user-defined name of the Schema.
    Labels map[string]string

    The Google Cloud labels for the Schema.

    Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effectiveLabels for all of the labels present on the resource.

    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    location String
    The location of the resource.
    displayName String
    The user-defined name of the Schema.
    labels Map<String,String>

    The Google Cloud labels for the Schema.

    Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effectiveLabels for all of the labels present on the resource.

    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    location string
    The location of the resource.
    displayName string
    The user-defined name of the Schema.
    labels {[key: string]: string}

    The Google Cloud labels for the Schema.

    Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effectiveLabels for all of the labels present on the resource.

    project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    location str
    The location of the resource.
    display_name str
    The user-defined name of the Schema.
    labels Mapping[str, str]

    The Google Cloud labels for the Schema.

    Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effectiveLabels for all of the labels present on the resource.

    project str
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    location String
    The location of the resource.
    displayName String
    The user-defined name of the Schema.
    labels Map<String>

    The Google Cloud labels for the Schema.

    Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effectiveLabels for all of the labels present on the resource.

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

    Outputs

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

    CreateTime string
    The time when the Schema was created.
    EffectiveLabels Dictionary<string, string>
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    The resource name of the Schema.
    PulumiLabels Dictionary<string, string>
    The combination of labels configured directly on the resource and default labels configured on the provider.
    UpdateTime string
    The time when the Schema was last updated.
    CreateTime string
    The time when the Schema was created.
    EffectiveLabels map[string]string
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    The resource name of the Schema.
    PulumiLabels map[string]string
    The combination of labels configured directly on the resource and default labels configured on the provider.
    UpdateTime string
    The time when the Schema was last updated.
    createTime String
    The time when the Schema was created.
    effectiveLabels Map<String,String>
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    The resource name of the Schema.
    pulumiLabels Map<String,String>
    The combination of labels configured directly on the resource and default labels configured on the provider.
    updateTime String
    The time when the Schema was last updated.
    createTime string
    The time when the Schema was created.
    effectiveLabels {[key: string]: string}
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    The resource name of the Schema.
    pulumiLabels {[key: string]: string}
    The combination of labels configured directly on the resource and default labels configured on the provider.
    updateTime string
    The time when the Schema was last updated.
    create_time str
    The time when the Schema was created.
    effective_labels Mapping[str, str]
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
    id str
    The provider-assigned unique ID for this managed resource.
    name str
    The resource name of the Schema.
    pulumi_labels Mapping[str, str]
    The combination of labels configured directly on the resource and default labels configured on the provider.
    update_time str
    The time when the Schema was last updated.
    createTime String
    The time when the Schema was created.
    effectiveLabels Map<String>
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    The resource name of the Schema.
    pulumiLabels Map<String>
    The combination of labels configured directly on the resource and default labels configured on the provider.
    updateTime String
    The time when the Schema was last updated.

    Look up Existing Schema Resource

    Get an existing Schema 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?: SchemaState, opts?: CustomResourceOptions): Schema
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            create_time: Optional[str] = None,
            display_name: Optional[str] = None,
            effective_labels: Optional[Mapping[str, str]] = None,
            labels: Optional[Mapping[str, str]] = None,
            location: Optional[str] = None,
            name: Optional[str] = None,
            project: Optional[str] = None,
            pulumi_labels: Optional[Mapping[str, str]] = None,
            update_time: Optional[str] = None) -> Schema
    func GetSchema(ctx *Context, name string, id IDInput, state *SchemaState, opts ...ResourceOption) (*Schema, error)
    public static Schema Get(string name, Input<string> id, SchemaState? state, CustomResourceOptions? opts = null)
    public static Schema get(String name, Output<String> id, SchemaState state, CustomResourceOptions options)
    resources:  _:    type: gcp:documentai:Schema    get:      id: ${id}
    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:
    CreateTime string
    The time when the Schema was created.
    DisplayName string
    The user-defined name of the Schema.
    EffectiveLabels Dictionary<string, string>
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
    Labels Dictionary<string, string>

    The Google Cloud labels for the Schema.

    Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effectiveLabels for all of the labels present on the resource.

    Location string
    The location of the resource.
    Name string
    The resource name of the Schema.
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    PulumiLabels Dictionary<string, string>
    The combination of labels configured directly on the resource and default labels configured on the provider.
    UpdateTime string
    The time when the Schema was last updated.
    CreateTime string
    The time when the Schema was created.
    DisplayName string
    The user-defined name of the Schema.
    EffectiveLabels map[string]string
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
    Labels map[string]string

    The Google Cloud labels for the Schema.

    Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effectiveLabels for all of the labels present on the resource.

    Location string
    The location of the resource.
    Name string
    The resource name of the Schema.
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    PulumiLabels map[string]string
    The combination of labels configured directly on the resource and default labels configured on the provider.
    UpdateTime string
    The time when the Schema was last updated.
    createTime String
    The time when the Schema was created.
    displayName String
    The user-defined name of the Schema.
    effectiveLabels Map<String,String>
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
    labels Map<String,String>

    The Google Cloud labels for the Schema.

    Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effectiveLabels for all of the labels present on the resource.

    location String
    The location of the resource.
    name String
    The resource name of the Schema.
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    pulumiLabels Map<String,String>
    The combination of labels configured directly on the resource and default labels configured on the provider.
    updateTime String
    The time when the Schema was last updated.
    createTime string
    The time when the Schema was created.
    displayName string
    The user-defined name of the Schema.
    effectiveLabels {[key: string]: string}
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
    labels {[key: string]: string}

    The Google Cloud labels for the Schema.

    Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effectiveLabels for all of the labels present on the resource.

    location string
    The location of the resource.
    name string
    The resource name of the Schema.
    project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    pulumiLabels {[key: string]: string}
    The combination of labels configured directly on the resource and default labels configured on the provider.
    updateTime string
    The time when the Schema was last updated.
    create_time str
    The time when the Schema was created.
    display_name str
    The user-defined name of the Schema.
    effective_labels Mapping[str, str]
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
    labels Mapping[str, str]

    The Google Cloud labels for the Schema.

    Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effectiveLabels for all of the labels present on the resource.

    location str
    The location of the resource.
    name str
    The resource name of the Schema.
    project str
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    pulumi_labels Mapping[str, str]
    The combination of labels configured directly on the resource and default labels configured on the provider.
    update_time str
    The time when the Schema was last updated.
    createTime String
    The time when the Schema was created.
    displayName String
    The user-defined name of the Schema.
    effectiveLabels Map<String>
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
    labels Map<String>

    The Google Cloud labels for the Schema.

    Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effectiveLabels for all of the labels present on the resource.

    location String
    The location of the resource.
    name String
    The resource name of the Schema.
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    pulumiLabels Map<String>
    The combination of labels configured directly on the resource and default labels configured on the provider.
    updateTime String
    The time when the Schema was last updated.

    Import

    Schema can be imported using any of these accepted formats:

    • projects/{{project}}/locations/{{location}}/schemas/{{name}}
    • {{project}}/{{location}}/{{name}}
    • {{location}}/{{name}}

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

    $ pulumi import gcp:documentai/schema:Schema default projects/{{project}}/locations/{{location}}/schemas/{{name}}
    $ pulumi import gcp:documentai/schema:Schema default {{project}}/{{location}}/{{name}}
    $ pulumi import gcp:documentai/schema:Schema default {{location}}/{{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
    Viewing docs for Google Cloud v9.22.0
    published on Friday, May 1, 2026 by Pulumi
      Try Pulumi Cloud free. Your team will thank you.