1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. discoveryengine
  5. Schema
Google Cloud v8.27.1 published on Friday, Apr 25, 2025 by Pulumi

gcp.discoveryengine.Schema

Explore with Pulumi AI

Schema defines the structure and layout of a type of document data.

To get more information about Schema, see:

Example Usage

Discoveryengine Schema Basic

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const basicDataStore = new gcp.discoveryengine.DataStore("basic", {
    location: "global",
    dataStoreId: "data-store-id",
    displayName: "tf-test-structured-datastore",
    industryVertical: "GENERIC",
    contentConfig: "NO_CONTENT",
    solutionTypes: ["SOLUTION_TYPE_SEARCH"],
    createAdvancedSiteSearch: false,
    skipDefaultSchemaCreation: true,
});
const basic = new gcp.discoveryengine.Schema("basic", {
    location: basicDataStore.location,
    dataStoreId: basicDataStore.dataStoreId,
    schemaId: "schema-id",
    jsonSchema: "{\"$schema\":\"https://json-schema.org/draft/2020-12/schema\",\"datetime_detection\":true,\"type\":\"object\",\"geolocation_detection\":true}",
});
Copy
import pulumi
import pulumi_gcp as gcp

basic_data_store = gcp.discoveryengine.DataStore("basic",
    location="global",
    data_store_id="data-store-id",
    display_name="tf-test-structured-datastore",
    industry_vertical="GENERIC",
    content_config="NO_CONTENT",
    solution_types=["SOLUTION_TYPE_SEARCH"],
    create_advanced_site_search=False,
    skip_default_schema_creation=True)
basic = gcp.discoveryengine.Schema("basic",
    location=basic_data_store.location,
    data_store_id=basic_data_store.data_store_id,
    schema_id="schema-id",
    json_schema="{\"$schema\":\"https://json-schema.org/draft/2020-12/schema\",\"datetime_detection\":true,\"type\":\"object\",\"geolocation_detection\":true}")
Copy
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/discoveryengine"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		basicDataStore, err := discoveryengine.NewDataStore(ctx, "basic", &discoveryengine.DataStoreArgs{
			Location:         pulumi.String("global"),
			DataStoreId:      pulumi.String("data-store-id"),
			DisplayName:      pulumi.String("tf-test-structured-datastore"),
			IndustryVertical: pulumi.String("GENERIC"),
			ContentConfig:    pulumi.String("NO_CONTENT"),
			SolutionTypes: pulumi.StringArray{
				pulumi.String("SOLUTION_TYPE_SEARCH"),
			},
			CreateAdvancedSiteSearch:  pulumi.Bool(false),
			SkipDefaultSchemaCreation: pulumi.Bool(true),
		})
		if err != nil {
			return err
		}
		_, err = discoveryengine.NewSchema(ctx, "basic", &discoveryengine.SchemaArgs{
			Location:    basicDataStore.Location,
			DataStoreId: basicDataStore.DataStoreId,
			SchemaId:    pulumi.String("schema-id"),
			JsonSchema:  pulumi.String("{\"$schema\":\"https://json-schema.org/draft/2020-12/schema\",\"datetime_detection\":true,\"type\":\"object\",\"geolocation_detection\":true}"),
		})
		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 basicDataStore = new Gcp.DiscoveryEngine.DataStore("basic", new()
    {
        Location = "global",
        DataStoreId = "data-store-id",
        DisplayName = "tf-test-structured-datastore",
        IndustryVertical = "GENERIC",
        ContentConfig = "NO_CONTENT",
        SolutionTypes = new[]
        {
            "SOLUTION_TYPE_SEARCH",
        },
        CreateAdvancedSiteSearch = false,
        SkipDefaultSchemaCreation = true,
    });

    var basic = new Gcp.DiscoveryEngine.Schema("basic", new()
    {
        Location = basicDataStore.Location,
        DataStoreId = basicDataStore.DataStoreId,
        SchemaId = "schema-id",
        JsonSchema = "{\"$schema\":\"https://json-schema.org/draft/2020-12/schema\",\"datetime_detection\":true,\"type\":\"object\",\"geolocation_detection\":true}",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.discoveryengine.DataStore;
import com.pulumi.gcp.discoveryengine.DataStoreArgs;
import com.pulumi.gcp.discoveryengine.Schema;
import com.pulumi.gcp.discoveryengine.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 basicDataStore = new DataStore("basicDataStore", DataStoreArgs.builder()
            .location("global")
            .dataStoreId("data-store-id")
            .displayName("tf-test-structured-datastore")
            .industryVertical("GENERIC")
            .contentConfig("NO_CONTENT")
            .solutionTypes("SOLUTION_TYPE_SEARCH")
            .createAdvancedSiteSearch(false)
            .skipDefaultSchemaCreation(true)
            .build());

        var basic = new Schema("basic", SchemaArgs.builder()
            .location(basicDataStore.location())
            .dataStoreId(basicDataStore.dataStoreId())
            .schemaId("schema-id")
            .jsonSchema("{\"$schema\":\"https://json-schema.org/draft/2020-12/schema\",\"datetime_detection\":true,\"type\":\"object\",\"geolocation_detection\":true}")
            .build());

    }
}
Copy
resources:
  basic:
    type: gcp:discoveryengine:Schema
    properties:
      location: ${basicDataStore.location}
      dataStoreId: ${basicDataStore.dataStoreId}
      schemaId: schema-id
      jsonSchema: '{"$schema":"https://json-schema.org/draft/2020-12/schema","datetime_detection":true,"type":"object","geolocation_detection":true}'
  basicDataStore:
    type: gcp:discoveryengine:DataStore
    name: basic
    properties:
      location: global
      dataStoreId: data-store-id
      displayName: tf-test-structured-datastore
      industryVertical: GENERIC
      contentConfig: NO_CONTENT
      solutionTypes:
        - SOLUTION_TYPE_SEARCH
      createAdvancedSiteSearch: false
      skipDefaultSchemaCreation: true
Copy

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,
           data_store_id: Optional[str] = None,
           location: Optional[str] = None,
           schema_id: Optional[str] = None,
           json_schema: Optional[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:discoveryengine:Schema
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. SchemaArgs
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. 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 This property is required. string
The unique name of the resource.
args This property is required. SchemaArgs
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. SchemaArgs
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. 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 schemaResource = new Gcp.DiscoveryEngine.Schema("schemaResource", new()
{
    DataStoreId = "string",
    Location = "string",
    SchemaId = "string",
    JsonSchema = "string",
    Project = "string",
});
Copy
example, err := discoveryengine.NewSchema(ctx, "schemaResource", &discoveryengine.SchemaArgs{
	DataStoreId: pulumi.String("string"),
	Location:    pulumi.String("string"),
	SchemaId:    pulumi.String("string"),
	JsonSchema:  pulumi.String("string"),
	Project:     pulumi.String("string"),
})
Copy
var schemaResource = new com.pulumi.gcp.discoveryengine.Schema("schemaResource", com.pulumi.gcp.discoveryengine.SchemaArgs.builder()
    .dataStoreId("string")
    .location("string")
    .schemaId("string")
    .jsonSchema("string")
    .project("string")
    .build());
Copy
schema_resource = gcp.discoveryengine.Schema("schemaResource",
    data_store_id="string",
    location="string",
    schema_id="string",
    json_schema="string",
    project="string")
Copy
const schemaResource = new gcp.discoveryengine.Schema("schemaResource", {
    dataStoreId: "string",
    location: "string",
    schemaId: "string",
    jsonSchema: "string",
    project: "string",
});
Copy
type: gcp:discoveryengine:Schema
properties:
    dataStoreId: string
    jsonSchema: string
    location: string
    project: string
    schemaId: string
Copy

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:

DataStoreId
This property is required.
Changes to this property will trigger replacement.
string
The unique id of the data store.
Location
This property is required.
Changes to this property will trigger replacement.
string
The geographic location where the data store should reside. The value can only be one of "global", "us" and "eu".
SchemaId
This property is required.
Changes to this property will trigger replacement.
string
The unique id of the schema.


JsonSchema Changes to this property will trigger replacement. string
The JSON representation of the schema.
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.
DataStoreId
This property is required.
Changes to this property will trigger replacement.
string
The unique id of the data store.
Location
This property is required.
Changes to this property will trigger replacement.
string
The geographic location where the data store should reside. The value can only be one of "global", "us" and "eu".
SchemaId
This property is required.
Changes to this property will trigger replacement.
string
The unique id of the schema.


JsonSchema Changes to this property will trigger replacement. string
The JSON representation of the schema.
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.
dataStoreId
This property is required.
Changes to this property will trigger replacement.
String
The unique id of the data store.
location
This property is required.
Changes to this property will trigger replacement.
String
The geographic location where the data store should reside. The value can only be one of "global", "us" and "eu".
schemaId
This property is required.
Changes to this property will trigger replacement.
String
The unique id of the schema.


jsonSchema Changes to this property will trigger replacement. String
The JSON representation of the schema.
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.
dataStoreId
This property is required.
Changes to this property will trigger replacement.
string
The unique id of the data store.
location
This property is required.
Changes to this property will trigger replacement.
string
The geographic location where the data store should reside. The value can only be one of "global", "us" and "eu".
schemaId
This property is required.
Changes to this property will trigger replacement.
string
The unique id of the schema.


jsonSchema Changes to this property will trigger replacement. string
The JSON representation of the schema.
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.
data_store_id
This property is required.
Changes to this property will trigger replacement.
str
The unique id of the data store.
location
This property is required.
Changes to this property will trigger replacement.
str
The geographic location where the data store should reside. The value can only be one of "global", "us" and "eu".
schema_id
This property is required.
Changes to this property will trigger replacement.
str
The unique id of the schema.


json_schema Changes to this property will trigger replacement. str
The JSON representation of the schema.
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.
dataStoreId
This property is required.
Changes to this property will trigger replacement.
String
The unique id of the data store.
location
This property is required.
Changes to this property will trigger replacement.
String
The geographic location where the data store should reside. The value can only be one of "global", "us" and "eu".
schemaId
This property is required.
Changes to this property will trigger replacement.
String
The unique id of the schema.


jsonSchema Changes to this property will trigger replacement. String
The JSON representation of the schema.
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.

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
Name string
The unique full resource name of the schema. Values are of the format projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/schemas/{schema_id}. This field must be a UTF-8 encoded string with a length limit of 1024 characters.
Id string
The provider-assigned unique ID for this managed resource.
Name string
The unique full resource name of the schema. Values are of the format projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/schemas/{schema_id}. This field must be a UTF-8 encoded string with a length limit of 1024 characters.
id String
The provider-assigned unique ID for this managed resource.
name String
The unique full resource name of the schema. Values are of the format projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/schemas/{schema_id}. This field must be a UTF-8 encoded string with a length limit of 1024 characters.
id string
The provider-assigned unique ID for this managed resource.
name string
The unique full resource name of the schema. Values are of the format projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/schemas/{schema_id}. This field must be a UTF-8 encoded string with a length limit of 1024 characters.
id str
The provider-assigned unique ID for this managed resource.
name str
The unique full resource name of the schema. Values are of the format projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/schemas/{schema_id}. This field must be a UTF-8 encoded string with a length limit of 1024 characters.
id String
The provider-assigned unique ID for this managed resource.
name String
The unique full resource name of the schema. Values are of the format projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/schemas/{schema_id}. This field must be a UTF-8 encoded string with a length limit of 1024 characters.

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,
        data_store_id: Optional[str] = None,
        json_schema: Optional[str] = None,
        location: Optional[str] = None,
        name: Optional[str] = None,
        project: Optional[str] = None,
        schema_id: 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:discoveryengine:Schema    get:      id: ${id}
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:
DataStoreId Changes to this property will trigger replacement. string
The unique id of the data store.
JsonSchema Changes to this property will trigger replacement. string
The JSON representation of the schema.
Location Changes to this property will trigger replacement. string
The geographic location where the data store should reside. The value can only be one of "global", "us" and "eu".
Name string
The unique full resource name of the schema. Values are of the format projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/schemas/{schema_id}. This field must be a UTF-8 encoded string with a length limit of 1024 characters.
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.
SchemaId Changes to this property will trigger replacement. string
The unique id of the schema.


DataStoreId Changes to this property will trigger replacement. string
The unique id of the data store.
JsonSchema Changes to this property will trigger replacement. string
The JSON representation of the schema.
Location Changes to this property will trigger replacement. string
The geographic location where the data store should reside. The value can only be one of "global", "us" and "eu".
Name string
The unique full resource name of the schema. Values are of the format projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/schemas/{schema_id}. This field must be a UTF-8 encoded string with a length limit of 1024 characters.
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.
SchemaId Changes to this property will trigger replacement. string
The unique id of the schema.


dataStoreId Changes to this property will trigger replacement. String
The unique id of the data store.
jsonSchema Changes to this property will trigger replacement. String
The JSON representation of the schema.
location Changes to this property will trigger replacement. String
The geographic location where the data store should reside. The value can only be one of "global", "us" and "eu".
name String
The unique full resource name of the schema. Values are of the format projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/schemas/{schema_id}. This field must be a UTF-8 encoded string with a length limit of 1024 characters.
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.
schemaId Changes to this property will trigger replacement. String
The unique id of the schema.


dataStoreId Changes to this property will trigger replacement. string
The unique id of the data store.
jsonSchema Changes to this property will trigger replacement. string
The JSON representation of the schema.
location Changes to this property will trigger replacement. string
The geographic location where the data store should reside. The value can only be one of "global", "us" and "eu".
name string
The unique full resource name of the schema. Values are of the format projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/schemas/{schema_id}. This field must be a UTF-8 encoded string with a length limit of 1024 characters.
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.
schemaId Changes to this property will trigger replacement. string
The unique id of the schema.


data_store_id Changes to this property will trigger replacement. str
The unique id of the data store.
json_schema Changes to this property will trigger replacement. str
The JSON representation of the schema.
location Changes to this property will trigger replacement. str
The geographic location where the data store should reside. The value can only be one of "global", "us" and "eu".
name str
The unique full resource name of the schema. Values are of the format projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/schemas/{schema_id}. This field must be a UTF-8 encoded string with a length limit of 1024 characters.
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.
schema_id Changes to this property will trigger replacement. str
The unique id of the schema.


dataStoreId Changes to this property will trigger replacement. String
The unique id of the data store.
jsonSchema Changes to this property will trigger replacement. String
The JSON representation of the schema.
location Changes to this property will trigger replacement. String
The geographic location where the data store should reside. The value can only be one of "global", "us" and "eu".
name String
The unique full resource name of the schema. Values are of the format projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/schemas/{schema_id}. This field must be a UTF-8 encoded string with a length limit of 1024 characters.
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.
schemaId Changes to this property will trigger replacement. String
The unique id of the schema.


Import

Schema can be imported using any of these accepted formats:

  • projects/{{project}}/locations/{{location}}/collections/default_collection/dataStores/{{data_store_id}}/schemas/{{schema_id}}

  • {{project}}/{{location}}/{{data_store_id}}/{{schema_id}}

  • {{location}}/{{data_store_id}}/{{schema_id}}

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

$ pulumi import gcp:discoveryengine/schema:Schema default projects/{{project}}/locations/{{location}}/collections/default_collection/dataStores/{{data_store_id}}/schemas/{{schema_id}}
Copy
$ pulumi import gcp:discoveryengine/schema:Schema default {{project}}/{{location}}/{{data_store_id}}/{{schema_id}}
Copy
$ pulumi import gcp:discoveryengine/schema:Schema default {{location}}/{{data_store_id}}/{{schema_id}}
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.