blob: 8a5ef116f717abb14e98cb6e03124a9a7a84a585 [file] [log] [blame] [edit]
---
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** Type: MMv1 ***
#
# ----------------------------------------------------------------------------
#
# This file is automatically generated by Magic Modules and manual
# changes will be clobbered when the file is regenerated.
#
# Please read more about how to change this file in
# .github/CONTRIBUTING.md.
#
# ----------------------------------------------------------------------------
subcategory: "Discovery Engine"
description: |-
Schema defines the structure and layout of a type of document data.
---
# google_discovery_engine_schema
Schema defines the structure and layout of a type of document data.
To get more information about Schema, see:
* [API documentation](https://cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1/projects.locations.collections.dataStores.schemas)
* How-to Guides
* [Provide a schema for your data store](https://cloud.google.com/generative-ai-app-builder/docs/provide-schema)
<div class = "oics-button" style="float: right; margin: 0 0 -15px">
<a href="https://console.cloud.google.com/cloudshell/open?cloudshell_git_repo=https%3A%2F%2Fgithub.com%2Fterraform-google-modules%2Fdocs-examples.git&cloudshell_image=gcr.io%2Fcloudshell-images%2Fcloudshell%3Alatest&cloudshell_print=.%2Fmotd&cloudshell_tutorial=.%2Ftutorial.md&cloudshell_working_dir=discoveryengine_schema_basic&open_in_editor=main.tf" target="_blank">
<img alt="Open in Cloud Shell" src="//gstatic.com/cloudssh/images/open-btn.svg" style="max-height: 44px; margin: 32px auto; max-width: 100%;">
</a>
</div>
## Example Usage - Discoveryengine Schema Basic
```hcl
resource "google_discovery_engine_schema" "basic" {
location = google_discovery_engine_data_store.basic.location
data_store_id = google_discovery_engine_data_store.basic.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}"
}
resource "google_discovery_engine_data_store" "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
}
```
## Argument Reference
The following arguments are supported:
* `location` -
(Required)
The geographic location where the data store should reside. The value can
only be one of "global", "us" and "eu".
* `data_store_id` -
(Required)
The unique id of the data store.
* `schema_id` -
(Required)
The unique id of the schema.
- - -
* `json_schema` -
(Optional)
The JSON representation of the schema.
* `project` - (Optional) The ID of the project in which the resource belongs.
If it is not provided, the provider project is used.
## Attributes Reference
In addition to the arguments listed above, the following computed attributes are exported:
* `id` - an identifier for the resource with format `projects/{{project}}/locations/{{location}}/collections/default_collection/dataStores/{{data_store_id}}/schemas/{{schema_id}}`
* `name` -
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.
## Timeouts
This resource provides the following
[Timeouts](https://developer.hashicorp.com/terraform/plugin/sdkv2/resources/retries-and-customizable-timeouts) configuration options:
- `create` - Default is 60 minutes.
- `delete` - Default is 60 minutes.
## 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}}`
In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import Schema using one of the formats above. For example:
```tf
import {
id = "projects/{{project}}/locations/{{location}}/collections/default_collection/dataStores/{{data_store_id}}/schemas/{{schema_id}}"
to = google_discovery_engine_schema.default
}
```
When using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import), Schema can be imported using one of the formats above. For example:
```
$ terraform import google_discovery_engine_schema.default projects/{{project}}/locations/{{location}}/collections/default_collection/dataStores/{{data_store_id}}/schemas/{{schema_id}}
$ terraform import google_discovery_engine_schema.default {{project}}/{{location}}/{{data_store_id}}/{{schema_id}}
$ terraform import google_discovery_engine_schema.default {{location}}/{{data_store_id}}/{{schema_id}}
```
## User Project Overrides
This resource supports [User Project Overrides](https://registry.terraform.io/providers/hashicorp/google/latest/docs/guides/provider_reference#user_project_override).