A document schema is used to define document structure.
To get more information about DocumentSchema, see:
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" {
}
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.
project_number
-
(Required)
The unique identifier of the project.
location
-
(Required)
The location of the resource.
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.
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.
enum_type_options
-
(Optional)
Enum/categorical property.
Structure is documented below.
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.
The schema_sources
block supports:
name
-
(Optional)
The schema name in the source.
processor_type
-
(Optional)
The Doc AI processor type name.
The property_type_options
block supports:
property_definitions
-
(Required)
Defines the metadata for a schema property.
Structure is documented below.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.
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.
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.
The schema_sources
block supports:
name
-
(Optional)
The schema name in the source.
processor_type
-
(Optional)
The Doc AI processor type name.
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.
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.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.
This resource provides the following Timeouts configuration options:
create
- Default is 20 minutes.delete
- Default is 20 minutes.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 to import DocumentSchema using one of the formats above. For example:
import {
id = "projects/{{project_number}}/locations/{{location}}/documentSchemas/{{name}}"
to = google_document_ai_warehouse_document_schema.default
}
When using the terraform import
command, 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}}