| --- |
| # ---------------------------------------------------------------------------- |
| # |
| # *** 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: "Document AI Warehouse" |
| description: |- |
| A document schema is used to define document structure. |
| --- |
| |
| # google\_document\_ai\_warehouse\_document\_schema |
| |
| A document schema is used to define document structure. |
| |
| |
| To get more information about DocumentSchema, see: |
| |
| * [API documentation](https://cloud.google.com/document-warehouse/docs/reference/rest/v1/projects.locations.documentSchemas) |
| * How-to Guides |
| * [Official Documentation](https://cloud.google.com/document-warehouse/docs/manage-document-schemas) |
| |
| <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_working_dir=document_ai_warehouse_document_schema_text&cloudshell_image=gcr.io%2Fcloudshell-images%2Fcloudshell%3Alatest&open_in_editor=main.tf&cloudshell_print=.%2Fmotd&cloudshell_tutorial=.%2Ftutorial.md" 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 - Document Ai Warehouse Document Schema Text |
| |
| |
| ```hcl |
| resource "google_document_ai_warehouse_document_schema" "example_text" { |
| project_number = data.google_project.project.number |
| display_name = "test-property-text" |
| location = "us" |
| document_is_folder = false |
| |
| property_definitions { |
| name = "prop3" |
| display_name = "propdisp3" |
| is_repeatable = false |
| is_filterable = true |
| is_searchable = true |
| is_metadata = false |
| is_required = false |
| retrieval_importance = "HIGHEST" |
| schema_sources { |
| name = "dummy_source" |
| processor_type = "dummy_processor" |
| } |
| text_type_options {} |
| } |
| } |
| |
| data "google_project" "project" { |
| } |
| ``` |
| <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_working_dir=document_ai_warehouse_document_schema_integer&cloudshell_image=gcr.io%2Fcloudshell-images%2Fcloudshell%3Alatest&open_in_editor=main.tf&cloudshell_print=.%2Fmotd&cloudshell_tutorial=.%2Ftutorial.md" 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 - Document Ai Warehouse Document Schema Integer |
| |
| |
| ```hcl |
| resource "google_document_ai_warehouse_document_schema" "example_integer" { |
| project_number = data.google_project.project.number |
| display_name = "test-property-integer" |
| location = "us" |
| |
| property_definitions { |
| name = "prop1" |
| display_name = "propdisp1" |
| is_repeatable = false |
| is_filterable = true |
| is_searchable = true |
| is_metadata = false |
| is_required = false |
| retrieval_importance = "HIGHEST" |
| schema_sources { |
| name = "dummy_source" |
| processor_type = "dummy_processor" |
| } |
| integer_type_options {} |
| } |
| } |
| |
| data "google_project" "project" { |
| } |
| ``` |
| <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_working_dir=document_ai_warehouse_document_schema_float&cloudshell_image=gcr.io%2Fcloudshell-images%2Fcloudshell%3Alatest&open_in_editor=main.tf&cloudshell_print=.%2Fmotd&cloudshell_tutorial=.%2Ftutorial.md" 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 - Document Ai Warehouse Document Schema Float |
| |
| |
| ```hcl |
| resource "google_document_ai_warehouse_document_schema" "example_float" { |
| project_number = data.google_project.project.number |
| display_name = "test-property-float" |
| location = "us" |
| |
| property_definitions { |
| name = "prop2" |
| display_name = "propdisp2" |
| is_repeatable = false |
| is_filterable = true |
| is_searchable = true |
| is_metadata = false |
| is_required = false |
| retrieval_importance = "HIGHEST" |
| schema_sources { |
| name = "dummy_source" |
| processor_type = "dummy_processor" |
| } |
| float_type_options {} |
| } |
| } |
| data "google_project" "project" { |
| } |
| ``` |
| <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_working_dir=document_ai_warehouse_document_schema_property&cloudshell_image=gcr.io%2Fcloudshell-images%2Fcloudshell%3Alatest&open_in_editor=main.tf&cloudshell_print=.%2Fmotd&cloudshell_tutorial=.%2Ftutorial.md" 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 - Document Ai Warehouse Document Schema Property |
| |
| |
| ```hcl |
| resource "google_document_ai_warehouse_document_schema" "example_property" { |
| project_number = data.google_project.project.number |
| display_name = "test-property-property" |
| location = "us" |
| document_is_folder = false |
| |
| property_definitions { |
| name = "prop8" |
| display_name = "propdisp8" |
| is_repeatable = false |
| is_filterable = true |
| is_searchable = true |
| is_metadata = false |
| is_required = false |
| retrieval_importance = "HIGHEST" |
| schema_sources { |
| name = "dummy_source" |
| processor_type = "dummy_processor" |
| } |
| property_type_options { |
| property_definitions { |
| name = "prop8_nested" |
| display_name = "propdisp8_nested" |
| is_repeatable = false |
| is_filterable = true |
| is_searchable = true |
| is_metadata = false |
| is_required = false |
| retrieval_importance = "HIGHEST" |
| schema_sources { |
| name = "dummy_source_nested" |
| processor_type = "dummy_processor_nested" |
| } |
| text_type_options {} |
| } |
| } |
| } |
| } |
| |
| data "google_project" "project" { |
| } |
| ``` |
| <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_working_dir=document_ai_warehouse_document_schema_property_enum&cloudshell_image=gcr.io%2Fcloudshell-images%2Fcloudshell%3Alatest&open_in_editor=main.tf&cloudshell_print=.%2Fmotd&cloudshell_tutorial=.%2Ftutorial.md" 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 - Document Ai Warehouse Document Schema Property Enum |
| |
| |
| ```hcl |
| resource "google_document_ai_warehouse_document_schema" "example_property_enum" { |
| project_number = data.google_project.project.number |
| display_name = "test-property-property" |
| location = "us" |
| document_is_folder = false |
| |
| property_definitions { |
| name = "prop8" |
| display_name = "propdisp8" |
| is_repeatable = false |
| is_filterable = true |
| is_searchable = true |
| is_metadata = false |
| is_required = false |
| retrieval_importance = "HIGHEST" |
| schema_sources { |
| name = "dummy_source" |
| processor_type = "dummy_processor" |
| } |
| property_type_options { |
| property_definitions { |
| name = "prop8_nested" |
| display_name = "propdisp8_nested" |
| is_repeatable = false |
| is_filterable = true |
| is_searchable = true |
| is_metadata = false |
| is_required = false |
| retrieval_importance = "HIGHEST" |
| schema_sources { |
| name = "dummy_source_nested" |
| processor_type = "dummy_processor_nested" |
| } |
| enum_type_options { |
| possible_values = [ |
| "M", |
| "F", |
| "X" |
| ] |
| validation_check_disabled = false |
| } |
| } |
| } |
| } |
| } |
| |
| data "google_project" "project" { |
| } |
| ``` |
| <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_working_dir=document_ai_warehouse_document_schema_enum&cloudshell_image=gcr.io%2Fcloudshell-images%2Fcloudshell%3Alatest&open_in_editor=main.tf&cloudshell_print=.%2Fmotd&cloudshell_tutorial=.%2Ftutorial.md" 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 - Document Ai Warehouse Document Schema Enum |
| |
| |
| ```hcl |
| resource "google_document_ai_warehouse_document_schema" "example_enum" { |
| project_number = data.google_project.project.number |
| display_name = "test-property-enum" |
| location = "us" |
| |
| property_definitions { |
| name = "prop6" |
| display_name = "propdisp6" |
| is_repeatable = false |
| is_filterable = true |
| is_searchable = true |
| is_metadata = false |
| is_required = false |
| retrieval_importance = "HIGHEST" |
| schema_sources { |
| name = "dummy_source" |
| processor_type = "dummy_processor" |
| } |
| enum_type_options { |
| possible_values = [ |
| "M", |
| "F", |
| "X" |
| ] |
| validation_check_disabled = false |
| } |
| } |
| } |
| |
| data "google_project" "project" { |
| } |
| ``` |
| <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_working_dir=document_ai_warehouse_document_schema_map&cloudshell_image=gcr.io%2Fcloudshell-images%2Fcloudshell%3Alatest&open_in_editor=main.tf&cloudshell_print=.%2Fmotd&cloudshell_tutorial=.%2Ftutorial.md" 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 - Document Ai Warehouse Document Schema Map |
| |
| |
| ```hcl |
| resource "google_document_ai_warehouse_document_schema" "example_map" { |
| project_number = data.google_project.project.number |
| display_name = "test-property-map" |
| location = "us" |
| |
| property_definitions { |
| name = "prop4" |
| display_name = "propdisp4" |
| is_repeatable = false |
| is_filterable = true |
| is_searchable = true |
| is_metadata = false |
| is_required = false |
| retrieval_importance = "HIGHEST" |
| schema_sources { |
| name = "dummy_source" |
| processor_type = "dummy_processor" |
| } |
| map_type_options {} |
| } |
| } |
| |
| data "google_project" "project" { |
| } |
| ``` |
| <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_working_dir=document_ai_warehouse_document_schema_datetime&cloudshell_image=gcr.io%2Fcloudshell-images%2Fcloudshell%3Alatest&open_in_editor=main.tf&cloudshell_print=.%2Fmotd&cloudshell_tutorial=.%2Ftutorial.md" 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 - Document Ai Warehouse Document Schema Datetime |
| |
| |
| ```hcl |
| resource "google_document_ai_warehouse_document_schema" "example_datetime" { |
| project_number = data.google_project.project.number |
| display_name = "test-property-date_time" |
| location = "us" |
| |
| property_definitions { |
| name = "prop7" |
| display_name = "propdisp7" |
| is_repeatable = false |
| is_filterable = true |
| is_searchable = true |
| is_metadata = false |
| is_required = false |
| retrieval_importance = "HIGHEST" |
| schema_sources { |
| name = "dummy_source" |
| processor_type = "dummy_processor" |
| } |
| date_time_type_options {} |
| } |
| } |
| |
| data "google_project" "project" { |
| } |
| ``` |
| <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_working_dir=document_ai_warehouse_document_schema_timestamp&cloudshell_image=gcr.io%2Fcloudshell-images%2Fcloudshell%3Alatest&open_in_editor=main.tf&cloudshell_print=.%2Fmotd&cloudshell_tutorial=.%2Ftutorial.md" 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 - Document Ai Warehouse Document Schema Timestamp |
| |
| |
| ```hcl |
| resource "google_document_ai_warehouse_document_schema" "example_timestamp" { |
| project_number = data.google_project.project.number |
| display_name = "test-property-timestamp" |
| location = "us" |
| |
| property_definitions { |
| name = "prop5" |
| display_name = "propdisp5" |
| is_repeatable = false |
| is_filterable = true |
| is_searchable = true |
| is_metadata = false |
| is_required = false |
| retrieval_importance = "HIGHEST" |
| schema_sources { |
| name = "dummy_source" |
| processor_type = "dummy_processor" |
| } |
| timestamp_type_options {} |
| } |
| } |
| |
| data "google_project" "project" { |
| } |
| ``` |
| |
| ## Argument Reference |
| |
| The following arguments are supported: |
| |
| |
| * `display_name` - |
| (Required) |
| Name of the schema given by the user. |
| |
| * `property_definitions` - |
| (Required) |
| Defines the metadata for a schema property. |
| Structure is [documented below](#nested_property_definitions). |
| |
| * `project_number` - |
| (Required) |
| The unique identifier of the project. |
| |
| * `location` - |
| (Required) |
| The location of the resource. |
| |
| |
| <a name="nested_property_definitions"></a>The `property_definitions` block supports: |
| |
| * `name` - |
| (Required) |
| The name of the metadata property. |
| |
| * `display_name` - |
| (Optional) |
| The display-name for the property, used for front-end. |
| |
| * `is_repeatable` - |
| (Optional) |
| Whether the property can have multiple values. |
| |
| * `is_filterable` - |
| (Optional) |
| Whether the property can be filtered. If this is a sub-property, all the parent properties must be marked filterable. |
| |
| * `is_searchable` - |
| (Optional) |
| Indicates that the property should be included in a global search. |
| |
| * `is_metadata` - |
| (Optional) |
| Whether the property is user supplied metadata. |
| |
| * `is_required` - |
| (Optional) |
| Whether the property is mandatory. |
| |
| * `retrieval_importance` - |
| (Optional) |
| Stores the retrieval importance. |
| Possible values are: `HIGHEST`, `HIGHER`, `HIGH`, `MEDIUM`, `LOW`, `LOWEST`. |
| |
| * `schema_sources` - |
| (Optional) |
| The schema source information. |
| Structure is [documented below](#nested_schema_sources). |
| |
| * `integer_type_options` - |
| (Optional) |
| Integer property. |
| |
| * `float_type_options` - |
| (Optional) |
| Float property. |
| |
| * `text_type_options` - |
| (Optional) |
| Text/string property. |
| |
| * `property_type_options` - |
| (Optional) |
| Nested structured data property. |
| Structure is [documented below](#nested_property_type_options). |
| |
| * `enum_type_options` - |
| (Optional) |
| Enum/categorical property. |
| Structure is [documented below](#nested_enum_type_options). |
| |
| * `date_time_type_options` - |
| (Optional) |
| Date time property. Not supported by CMEK compliant deployment. |
| |
| * `map_type_options` - |
| (Optional) |
| Map property. |
| |
| * `timestamp_type_options` - |
| (Optional) |
| Timestamp property. Not supported by CMEK compliant deployment. |
| |
| |
| <a name="nested_schema_sources"></a>The `schema_sources` block supports: |
| |
| * `name` - |
| (Optional) |
| The schema name in the source. |
| |
| * `processor_type` - |
| (Optional) |
| The Doc AI processor type name. |
| |
| <a name="nested_property_type_options"></a>The `property_type_options` block supports: |
| |
| * `property_definitions` - |
| (Required) |
| Defines the metadata for a schema property. |
| Structure is [documented below](#nested_property_definitions). |
| |
| |
| <a name="nested_property_definitions"></a>The `property_definitions` block supports: |
| |
| * `name` - |
| (Required) |
| The name of the metadata property. |
| |
| * `display_name` - |
| (Optional) |
| The display-name for the property, used for front-end. |
| |
| * `is_repeatable` - |
| (Optional) |
| Whether the property can have multiple values. |
| |
| * `is_filterable` - |
| (Optional) |
| Whether the property can be filtered. If this is a sub-property, all the parent properties must be marked filterable. |
| |
| * `is_searchable` - |
| (Optional) |
| Indicates that the property should be included in a global search. |
| |
| * `is_metadata` - |
| (Optional) |
| Whether the property is user supplied metadata. |
| |
| * `is_required` - |
| (Optional) |
| Whether the property is mandatory. |
| |
| * `retrieval_importance` - |
| (Optional) |
| Stores the retrieval importance. |
| Possible values are: `HIGHEST`, `HIGHER`, `HIGH`, `MEDIUM`, `LOW`, `LOWEST`. |
| |
| * `schema_sources` - |
| (Optional) |
| The schema source information. |
| Structure is [documented below](#nested_schema_sources). |
| |
| * `integer_type_options` - |
| (Optional) |
| Integer property. |
| |
| * `float_type_options` - |
| (Optional) |
| Float property. |
| |
| * `text_type_options` - |
| (Optional) |
| Text property. |
| |
| * `enum_type_options` - |
| (Optional) |
| Enum/categorical property. |
| Structure is [documented below](#nested_enum_type_options). |
| |
| * `date_time_type_options` - |
| (Optional) |
| Date time property. Not supported by CMEK compliant deployment. |
| |
| * `map_type_options` - |
| (Optional) |
| Map property. |
| |
| * `timestamp_type_options` - |
| (Optional) |
| Timestamp property. Not supported by CMEK compliant deployment. |
| |
| |
| <a name="nested_schema_sources"></a>The `schema_sources` block supports: |
| |
| * `name` - |
| (Optional) |
| The schema name in the source. |
| |
| * `processor_type` - |
| (Optional) |
| The Doc AI processor type name. |
| |
| <a name="nested_enum_type_options"></a>The `enum_type_options` block supports: |
| |
| * `possible_values` - |
| (Required) |
| List of possible enum values. |
| |
| * `validation_check_disabled` - |
| (Optional) |
| Make sure the enum property value provided in the document is in the possile value list during document creation. The validation check runs by default. |
| |
| <a name="nested_enum_type_options"></a>The `enum_type_options` block supports: |
| |
| * `possible_values` - |
| (Required) |
| List of possible enum values. |
| |
| * `validation_check_disabled` - |
| (Optional) |
| Make sure the enum property value provided in the document is in the possile value list during document creation. The validation check runs by default. |
| |
| - - - |
| |
| |
| * `document_is_folder` - |
| (Optional) |
| Tells whether the document is a folder or a typical document. |
| |
| |
| ## Attributes Reference |
| |
| In addition to the arguments listed above, the following computed attributes are exported: |
| |
| * `id` - an identifier for the resource with format `{{name}}` |
| |
| * `name` - |
| The resource name of the document schema. |
| |
| |
| ## Timeouts |
| |
| This resource provides the following |
| [Timeouts](https://developer.hashicorp.com/terraform/plugin/sdkv2/resources/retries-and-customizable-timeouts) configuration options: |
| |
| - `create` - Default is 20 minutes. |
| - `delete` - Default is 20 minutes. |
| |
| ## Import |
| |
| |
| DocumentSchema can be imported using any of these accepted formats: |
| |
| * `projects/{{project_number}}/locations/{{location}}/documentSchemas/{{name}}` |
| * `{{project_number}}/{{location}}/{{name}}` |
| |
| |
| In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import DocumentSchema using one of the formats above. For example: |
| |
| ```tf |
| import { |
| id = "projects/{{project_number}}/locations/{{location}}/documentSchemas/{{name}}" |
| to = google_document_ai_warehouse_document_schema.default |
| } |
| ``` |
| |
| When using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import), DocumentSchema can be imported using one of the formats above. For example: |
| |
| ``` |
| $ terraform import google_document_ai_warehouse_document_schema.default projects/{{project_number}}/locations/{{location}}/documentSchemas/{{name}} |
| $ terraform import google_document_ai_warehouse_document_schema.default {{project_number}}/{{location}}/{{name}} |
| ``` |