From b49d33c1a0f9424797f9a1baa4a3cacbb7f05261 Mon Sep 17 00:00:00 2001 From: The Magician Date: Fri, 28 Jul 2023 09:24:58 -0700 Subject: [PATCH] adding location and doc schema (#8371) (#477) * adding location and doc schema * added copyright * resolved required field, url_param_only field, description, autogen_async, async in Location * resolved required field, url_param_only field, description, autogen_async, async in Location * resolved hardcoded location, few fields in location, removed unnecessary enum values * resolved project_number, added fields in location example * DocumentSchema final changes * added timeouts in Location * adding missing fields from test report * added DocumentSchema tests * removed required field from processorType * changed dummy_values * removed fields under properties * added new line * added enum tests * separated tests into separate files * made Document Schema immutable Signed-off-by: Modular Magician --- .../backing_file.tf | 15 ++++ .../main.tf | 24 ++++++ .../motd | 7 ++ .../tutorial.md | 79 +++++++++++++++++++ .../backing_file.tf | 15 ++++ .../main.tf | 31 ++++++++ .../motd | 7 ++ .../tutorial.md | 79 +++++++++++++++++++ .../backing_file.tf | 15 ++++ .../main.tf | 23 ++++++ .../motd | 7 ++ .../tutorial.md | 79 +++++++++++++++++++ .../backing_file.tf | 15 ++++ .../main.tf | 24 ++++++ .../motd | 7 ++ .../tutorial.md | 79 +++++++++++++++++++ .../backing_file.tf | 15 ++++ .../main.tf | 24 ++++++ .../motd | 7 ++ .../tutorial.md | 79 +++++++++++++++++++ .../backing_file.tf | 15 ++++ .../main.tf | 41 ++++++++++ .../motd | 7 ++ .../tutorial.md | 79 +++++++++++++++++++ .../backing_file.tf | 15 ++++ .../main.tf | 48 +++++++++++ .../motd | 7 ++ .../tutorial.md | 79 +++++++++++++++++++ .../backing_file.tf | 15 ++++ .../main.tf | 25 ++++++ .../motd | 7 ++ .../tutorial.md | 79 +++++++++++++++++++ .../backing_file.tf | 15 ++++ .../main.tf | 24 ++++++ .../motd | 7 ++ .../tutorial.md | 79 +++++++++++++++++++ .../backing_file.tf | 15 ++++ document_ai_warehouse_location/main.tf | 11 +++ document_ai_warehouse_location/motd | 7 ++ document_ai_warehouse_location/tutorial.md | 79 +++++++++++++++++++ 40 files changed, 1285 insertions(+) create mode 100644 document_ai_warehouse_document_schema_datetime/backing_file.tf create mode 100644 document_ai_warehouse_document_schema_datetime/main.tf create mode 100644 document_ai_warehouse_document_schema_datetime/motd create mode 100644 document_ai_warehouse_document_schema_datetime/tutorial.md create mode 100644 document_ai_warehouse_document_schema_enum/backing_file.tf create mode 100644 document_ai_warehouse_document_schema_enum/main.tf create mode 100644 document_ai_warehouse_document_schema_enum/motd create mode 100644 document_ai_warehouse_document_schema_enum/tutorial.md create mode 100644 document_ai_warehouse_document_schema_float/backing_file.tf create mode 100644 document_ai_warehouse_document_schema_float/main.tf create mode 100644 document_ai_warehouse_document_schema_float/motd create mode 100644 document_ai_warehouse_document_schema_float/tutorial.md create mode 100644 document_ai_warehouse_document_schema_integer/backing_file.tf create mode 100644 document_ai_warehouse_document_schema_integer/main.tf create mode 100644 document_ai_warehouse_document_schema_integer/motd create mode 100644 document_ai_warehouse_document_schema_integer/tutorial.md create mode 100644 document_ai_warehouse_document_schema_map/backing_file.tf create mode 100644 document_ai_warehouse_document_schema_map/main.tf create mode 100644 document_ai_warehouse_document_schema_map/motd create mode 100644 document_ai_warehouse_document_schema_map/tutorial.md create mode 100644 document_ai_warehouse_document_schema_property/backing_file.tf create mode 100644 document_ai_warehouse_document_schema_property/main.tf create mode 100644 document_ai_warehouse_document_schema_property/motd create mode 100644 document_ai_warehouse_document_schema_property/tutorial.md create mode 100644 document_ai_warehouse_document_schema_property_enum/backing_file.tf create mode 100644 document_ai_warehouse_document_schema_property_enum/main.tf create mode 100644 document_ai_warehouse_document_schema_property_enum/motd create mode 100644 document_ai_warehouse_document_schema_property_enum/tutorial.md create mode 100644 document_ai_warehouse_document_schema_text/backing_file.tf create mode 100644 document_ai_warehouse_document_schema_text/main.tf create mode 100644 document_ai_warehouse_document_schema_text/motd create mode 100644 document_ai_warehouse_document_schema_text/tutorial.md create mode 100644 document_ai_warehouse_document_schema_timestamp/backing_file.tf create mode 100644 document_ai_warehouse_document_schema_timestamp/main.tf create mode 100644 document_ai_warehouse_document_schema_timestamp/motd create mode 100644 document_ai_warehouse_document_schema_timestamp/tutorial.md create mode 100644 document_ai_warehouse_location/backing_file.tf create mode 100644 document_ai_warehouse_location/main.tf create mode 100644 document_ai_warehouse_location/motd create mode 100644 document_ai_warehouse_location/tutorial.md diff --git a/document_ai_warehouse_document_schema_datetime/backing_file.tf b/document_ai_warehouse_document_schema_datetime/backing_file.tf new file mode 100644 index 00000000..c60b1199 --- /dev/null +++ b/document_ai_warehouse_document_schema_datetime/backing_file.tf @@ -0,0 +1,15 @@ +# This file has some scaffolding to make sure that names are unique and that +# a region and zone are selected when you try to create your Terraform resources. + +locals { + name_suffix = "${random_pet.suffix.id}" +} + +resource "random_pet" "suffix" { + length = 2 +} + +provider "google" { + region = "us-central1" + zone = "us-central1-c" +} diff --git a/document_ai_warehouse_document_schema_datetime/main.tf b/document_ai_warehouse_document_schema_datetime/main.tf new file mode 100644 index 00000000..0f62f077 --- /dev/null +++ b/document_ai_warehouse_document_schema_datetime/main.tf @@ -0,0 +1,24 @@ +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" { +} diff --git a/document_ai_warehouse_document_schema_datetime/motd b/document_ai_warehouse_document_schema_datetime/motd new file mode 100644 index 00000000..45a906e8 --- /dev/null +++ b/document_ai_warehouse_document_schema_datetime/motd @@ -0,0 +1,7 @@ +=== + +These examples use real resources that will be billed to the +Google Cloud Platform project you use - so make sure that you +run "terraform destroy" before quitting! + +=== diff --git a/document_ai_warehouse_document_schema_datetime/tutorial.md b/document_ai_warehouse_document_schema_datetime/tutorial.md new file mode 100644 index 00000000..dd9bafe2 --- /dev/null +++ b/document_ai_warehouse_document_schema_datetime/tutorial.md @@ -0,0 +1,79 @@ +# Document Ai Warehouse Document Schema Datetime - Terraform + +## Setup + + + +Welcome to Terraform in Google Cloud Shell! We need you to let us know what project you'd like to use with Terraform. + + + +Terraform provisions real GCP resources, so anything you create in this session will be billed against this project. + +## Terraforming! + +Let's use {{project-id}} with Terraform! Click the Cloud Shell icon below to copy the command +to your shell, and then run it from the shell by pressing Enter/Return. Terraform will pick up +the project name from the environment variable. + +```bash +export GOOGLE_CLOUD_PROJECT={{project-id}} +``` + +After that, let's get Terraform started. Run the following to pull in the providers. + +```bash +terraform init +``` + +With the providers downloaded and a project set, you're ready to use Terraform. Go ahead! + +```bash +terraform apply +``` + +Terraform will show you what it plans to do, and prompt you to accept. Type "yes" to accept the plan. + +```bash +yes +``` + + +## Post-Apply + +### Editing your config + +Now you've provisioned your resources in GCP! If you run a "plan", you should see no changes needed. + +```bash +terraform plan +``` + +So let's make a change! Try editing a number, or appending a value to the name in the editor. Then, +run a 'plan' again. + +```bash +terraform plan +``` + +Afterwards you can run an apply, which implicitly does a plan and shows you the intended changes +at the 'yes' prompt. + +```bash +terraform apply +``` + +```bash +yes +``` + +## Cleanup + +Run the following to remove the resources Terraform provisioned: + +```bash +terraform destroy +``` +```bash +yes +``` diff --git a/document_ai_warehouse_document_schema_enum/backing_file.tf b/document_ai_warehouse_document_schema_enum/backing_file.tf new file mode 100644 index 00000000..c60b1199 --- /dev/null +++ b/document_ai_warehouse_document_schema_enum/backing_file.tf @@ -0,0 +1,15 @@ +# This file has some scaffolding to make sure that names are unique and that +# a region and zone are selected when you try to create your Terraform resources. + +locals { + name_suffix = "${random_pet.suffix.id}" +} + +resource "random_pet" "suffix" { + length = 2 +} + +provider "google" { + region = "us-central1" + zone = "us-central1-c" +} diff --git a/document_ai_warehouse_document_schema_enum/main.tf b/document_ai_warehouse_document_schema_enum/main.tf new file mode 100644 index 00000000..b2affbf0 --- /dev/null +++ b/document_ai_warehouse_document_schema_enum/main.tf @@ -0,0 +1,31 @@ +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" { +} diff --git a/document_ai_warehouse_document_schema_enum/motd b/document_ai_warehouse_document_schema_enum/motd new file mode 100644 index 00000000..45a906e8 --- /dev/null +++ b/document_ai_warehouse_document_schema_enum/motd @@ -0,0 +1,7 @@ +=== + +These examples use real resources that will be billed to the +Google Cloud Platform project you use - so make sure that you +run "terraform destroy" before quitting! + +=== diff --git a/document_ai_warehouse_document_schema_enum/tutorial.md b/document_ai_warehouse_document_schema_enum/tutorial.md new file mode 100644 index 00000000..b6d7cf61 --- /dev/null +++ b/document_ai_warehouse_document_schema_enum/tutorial.md @@ -0,0 +1,79 @@ +# Document Ai Warehouse Document Schema Enum - Terraform + +## Setup + + + +Welcome to Terraform in Google Cloud Shell! We need you to let us know what project you'd like to use with Terraform. + + + +Terraform provisions real GCP resources, so anything you create in this session will be billed against this project. + +## Terraforming! + +Let's use {{project-id}} with Terraform! Click the Cloud Shell icon below to copy the command +to your shell, and then run it from the shell by pressing Enter/Return. Terraform will pick up +the project name from the environment variable. + +```bash +export GOOGLE_CLOUD_PROJECT={{project-id}} +``` + +After that, let's get Terraform started. Run the following to pull in the providers. + +```bash +terraform init +``` + +With the providers downloaded and a project set, you're ready to use Terraform. Go ahead! + +```bash +terraform apply +``` + +Terraform will show you what it plans to do, and prompt you to accept. Type "yes" to accept the plan. + +```bash +yes +``` + + +## Post-Apply + +### Editing your config + +Now you've provisioned your resources in GCP! If you run a "plan", you should see no changes needed. + +```bash +terraform plan +``` + +So let's make a change! Try editing a number, or appending a value to the name in the editor. Then, +run a 'plan' again. + +```bash +terraform plan +``` + +Afterwards you can run an apply, which implicitly does a plan and shows you the intended changes +at the 'yes' prompt. + +```bash +terraform apply +``` + +```bash +yes +``` + +## Cleanup + +Run the following to remove the resources Terraform provisioned: + +```bash +terraform destroy +``` +```bash +yes +``` diff --git a/document_ai_warehouse_document_schema_float/backing_file.tf b/document_ai_warehouse_document_schema_float/backing_file.tf new file mode 100644 index 00000000..c60b1199 --- /dev/null +++ b/document_ai_warehouse_document_schema_float/backing_file.tf @@ -0,0 +1,15 @@ +# This file has some scaffolding to make sure that names are unique and that +# a region and zone are selected when you try to create your Terraform resources. + +locals { + name_suffix = "${random_pet.suffix.id}" +} + +resource "random_pet" "suffix" { + length = 2 +} + +provider "google" { + region = "us-central1" + zone = "us-central1-c" +} diff --git a/document_ai_warehouse_document_schema_float/main.tf b/document_ai_warehouse_document_schema_float/main.tf new file mode 100644 index 00000000..1b3125ef --- /dev/null +++ b/document_ai_warehouse_document_schema_float/main.tf @@ -0,0 +1,23 @@ +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" { +} diff --git a/document_ai_warehouse_document_schema_float/motd b/document_ai_warehouse_document_schema_float/motd new file mode 100644 index 00000000..45a906e8 --- /dev/null +++ b/document_ai_warehouse_document_schema_float/motd @@ -0,0 +1,7 @@ +=== + +These examples use real resources that will be billed to the +Google Cloud Platform project you use - so make sure that you +run "terraform destroy" before quitting! + +=== diff --git a/document_ai_warehouse_document_schema_float/tutorial.md b/document_ai_warehouse_document_schema_float/tutorial.md new file mode 100644 index 00000000..52f31ba2 --- /dev/null +++ b/document_ai_warehouse_document_schema_float/tutorial.md @@ -0,0 +1,79 @@ +# Document Ai Warehouse Document Schema Float - Terraform + +## Setup + + + +Welcome to Terraform in Google Cloud Shell! We need you to let us know what project you'd like to use with Terraform. + + + +Terraform provisions real GCP resources, so anything you create in this session will be billed against this project. + +## Terraforming! + +Let's use {{project-id}} with Terraform! Click the Cloud Shell icon below to copy the command +to your shell, and then run it from the shell by pressing Enter/Return. Terraform will pick up +the project name from the environment variable. + +```bash +export GOOGLE_CLOUD_PROJECT={{project-id}} +``` + +After that, let's get Terraform started. Run the following to pull in the providers. + +```bash +terraform init +``` + +With the providers downloaded and a project set, you're ready to use Terraform. Go ahead! + +```bash +terraform apply +``` + +Terraform will show you what it plans to do, and prompt you to accept. Type "yes" to accept the plan. + +```bash +yes +``` + + +## Post-Apply + +### Editing your config + +Now you've provisioned your resources in GCP! If you run a "plan", you should see no changes needed. + +```bash +terraform plan +``` + +So let's make a change! Try editing a number, or appending a value to the name in the editor. Then, +run a 'plan' again. + +```bash +terraform plan +``` + +Afterwards you can run an apply, which implicitly does a plan and shows you the intended changes +at the 'yes' prompt. + +```bash +terraform apply +``` + +```bash +yes +``` + +## Cleanup + +Run the following to remove the resources Terraform provisioned: + +```bash +terraform destroy +``` +```bash +yes +``` diff --git a/document_ai_warehouse_document_schema_integer/backing_file.tf b/document_ai_warehouse_document_schema_integer/backing_file.tf new file mode 100644 index 00000000..c60b1199 --- /dev/null +++ b/document_ai_warehouse_document_schema_integer/backing_file.tf @@ -0,0 +1,15 @@ +# This file has some scaffolding to make sure that names are unique and that +# a region and zone are selected when you try to create your Terraform resources. + +locals { + name_suffix = "${random_pet.suffix.id}" +} + +resource "random_pet" "suffix" { + length = 2 +} + +provider "google" { + region = "us-central1" + zone = "us-central1-c" +} diff --git a/document_ai_warehouse_document_schema_integer/main.tf b/document_ai_warehouse_document_schema_integer/main.tf new file mode 100644 index 00000000..7313ee18 --- /dev/null +++ b/document_ai_warehouse_document_schema_integer/main.tf @@ -0,0 +1,24 @@ +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" { +} diff --git a/document_ai_warehouse_document_schema_integer/motd b/document_ai_warehouse_document_schema_integer/motd new file mode 100644 index 00000000..45a906e8 --- /dev/null +++ b/document_ai_warehouse_document_schema_integer/motd @@ -0,0 +1,7 @@ +=== + +These examples use real resources that will be billed to the +Google Cloud Platform project you use - so make sure that you +run "terraform destroy" before quitting! + +=== diff --git a/document_ai_warehouse_document_schema_integer/tutorial.md b/document_ai_warehouse_document_schema_integer/tutorial.md new file mode 100644 index 00000000..5711e315 --- /dev/null +++ b/document_ai_warehouse_document_schema_integer/tutorial.md @@ -0,0 +1,79 @@ +# Document Ai Warehouse Document Schema Integer - Terraform + +## Setup + + + +Welcome to Terraform in Google Cloud Shell! We need you to let us know what project you'd like to use with Terraform. + + + +Terraform provisions real GCP resources, so anything you create in this session will be billed against this project. + +## Terraforming! + +Let's use {{project-id}} with Terraform! Click the Cloud Shell icon below to copy the command +to your shell, and then run it from the shell by pressing Enter/Return. Terraform will pick up +the project name from the environment variable. + +```bash +export GOOGLE_CLOUD_PROJECT={{project-id}} +``` + +After that, let's get Terraform started. Run the following to pull in the providers. + +```bash +terraform init +``` + +With the providers downloaded and a project set, you're ready to use Terraform. Go ahead! + +```bash +terraform apply +``` + +Terraform will show you what it plans to do, and prompt you to accept. Type "yes" to accept the plan. + +```bash +yes +``` + + +## Post-Apply + +### Editing your config + +Now you've provisioned your resources in GCP! If you run a "plan", you should see no changes needed. + +```bash +terraform plan +``` + +So let's make a change! Try editing a number, or appending a value to the name in the editor. Then, +run a 'plan' again. + +```bash +terraform plan +``` + +Afterwards you can run an apply, which implicitly does a plan and shows you the intended changes +at the 'yes' prompt. + +```bash +terraform apply +``` + +```bash +yes +``` + +## Cleanup + +Run the following to remove the resources Terraform provisioned: + +```bash +terraform destroy +``` +```bash +yes +``` diff --git a/document_ai_warehouse_document_schema_map/backing_file.tf b/document_ai_warehouse_document_schema_map/backing_file.tf new file mode 100644 index 00000000..c60b1199 --- /dev/null +++ b/document_ai_warehouse_document_schema_map/backing_file.tf @@ -0,0 +1,15 @@ +# This file has some scaffolding to make sure that names are unique and that +# a region and zone are selected when you try to create your Terraform resources. + +locals { + name_suffix = "${random_pet.suffix.id}" +} + +resource "random_pet" "suffix" { + length = 2 +} + +provider "google" { + region = "us-central1" + zone = "us-central1-c" +} diff --git a/document_ai_warehouse_document_schema_map/main.tf b/document_ai_warehouse_document_schema_map/main.tf new file mode 100644 index 00000000..20af161a --- /dev/null +++ b/document_ai_warehouse_document_schema_map/main.tf @@ -0,0 +1,24 @@ +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" { +} diff --git a/document_ai_warehouse_document_schema_map/motd b/document_ai_warehouse_document_schema_map/motd new file mode 100644 index 00000000..45a906e8 --- /dev/null +++ b/document_ai_warehouse_document_schema_map/motd @@ -0,0 +1,7 @@ +=== + +These examples use real resources that will be billed to the +Google Cloud Platform project you use - so make sure that you +run "terraform destroy" before quitting! + +=== diff --git a/document_ai_warehouse_document_schema_map/tutorial.md b/document_ai_warehouse_document_schema_map/tutorial.md new file mode 100644 index 00000000..9746b3f7 --- /dev/null +++ b/document_ai_warehouse_document_schema_map/tutorial.md @@ -0,0 +1,79 @@ +# Document Ai Warehouse Document Schema Map - Terraform + +## Setup + + + +Welcome to Terraform in Google Cloud Shell! We need you to let us know what project you'd like to use with Terraform. + + + +Terraform provisions real GCP resources, so anything you create in this session will be billed against this project. + +## Terraforming! + +Let's use {{project-id}} with Terraform! Click the Cloud Shell icon below to copy the command +to your shell, and then run it from the shell by pressing Enter/Return. Terraform will pick up +the project name from the environment variable. + +```bash +export GOOGLE_CLOUD_PROJECT={{project-id}} +``` + +After that, let's get Terraform started. Run the following to pull in the providers. + +```bash +terraform init +``` + +With the providers downloaded and a project set, you're ready to use Terraform. Go ahead! + +```bash +terraform apply +``` + +Terraform will show you what it plans to do, and prompt you to accept. Type "yes" to accept the plan. + +```bash +yes +``` + + +## Post-Apply + +### Editing your config + +Now you've provisioned your resources in GCP! If you run a "plan", you should see no changes needed. + +```bash +terraform plan +``` + +So let's make a change! Try editing a number, or appending a value to the name in the editor. Then, +run a 'plan' again. + +```bash +terraform plan +``` + +Afterwards you can run an apply, which implicitly does a plan and shows you the intended changes +at the 'yes' prompt. + +```bash +terraform apply +``` + +```bash +yes +``` + +## Cleanup + +Run the following to remove the resources Terraform provisioned: + +```bash +terraform destroy +``` +```bash +yes +``` diff --git a/document_ai_warehouse_document_schema_property/backing_file.tf b/document_ai_warehouse_document_schema_property/backing_file.tf new file mode 100644 index 00000000..c60b1199 --- /dev/null +++ b/document_ai_warehouse_document_schema_property/backing_file.tf @@ -0,0 +1,15 @@ +# This file has some scaffolding to make sure that names are unique and that +# a region and zone are selected when you try to create your Terraform resources. + +locals { + name_suffix = "${random_pet.suffix.id}" +} + +resource "random_pet" "suffix" { + length = 2 +} + +provider "google" { + region = "us-central1" + zone = "us-central1-c" +} diff --git a/document_ai_warehouse_document_schema_property/main.tf b/document_ai_warehouse_document_schema_property/main.tf new file mode 100644 index 00000000..8cfdcaf8 --- /dev/null +++ b/document_ai_warehouse_document_schema_property/main.tf @@ -0,0 +1,41 @@ +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" { +} diff --git a/document_ai_warehouse_document_schema_property/motd b/document_ai_warehouse_document_schema_property/motd new file mode 100644 index 00000000..45a906e8 --- /dev/null +++ b/document_ai_warehouse_document_schema_property/motd @@ -0,0 +1,7 @@ +=== + +These examples use real resources that will be billed to the +Google Cloud Platform project you use - so make sure that you +run "terraform destroy" before quitting! + +=== diff --git a/document_ai_warehouse_document_schema_property/tutorial.md b/document_ai_warehouse_document_schema_property/tutorial.md new file mode 100644 index 00000000..2ba28ebe --- /dev/null +++ b/document_ai_warehouse_document_schema_property/tutorial.md @@ -0,0 +1,79 @@ +# Document Ai Warehouse Document Schema Property - Terraform + +## Setup + + + +Welcome to Terraform in Google Cloud Shell! We need you to let us know what project you'd like to use with Terraform. + + + +Terraform provisions real GCP resources, so anything you create in this session will be billed against this project. + +## Terraforming! + +Let's use {{project-id}} with Terraform! Click the Cloud Shell icon below to copy the command +to your shell, and then run it from the shell by pressing Enter/Return. Terraform will pick up +the project name from the environment variable. + +```bash +export GOOGLE_CLOUD_PROJECT={{project-id}} +``` + +After that, let's get Terraform started. Run the following to pull in the providers. + +```bash +terraform init +``` + +With the providers downloaded and a project set, you're ready to use Terraform. Go ahead! + +```bash +terraform apply +``` + +Terraform will show you what it plans to do, and prompt you to accept. Type "yes" to accept the plan. + +```bash +yes +``` + + +## Post-Apply + +### Editing your config + +Now you've provisioned your resources in GCP! If you run a "plan", you should see no changes needed. + +```bash +terraform plan +``` + +So let's make a change! Try editing a number, or appending a value to the name in the editor. Then, +run a 'plan' again. + +```bash +terraform plan +``` + +Afterwards you can run an apply, which implicitly does a plan and shows you the intended changes +at the 'yes' prompt. + +```bash +terraform apply +``` + +```bash +yes +``` + +## Cleanup + +Run the following to remove the resources Terraform provisioned: + +```bash +terraform destroy +``` +```bash +yes +``` diff --git a/document_ai_warehouse_document_schema_property_enum/backing_file.tf b/document_ai_warehouse_document_schema_property_enum/backing_file.tf new file mode 100644 index 00000000..c60b1199 --- /dev/null +++ b/document_ai_warehouse_document_schema_property_enum/backing_file.tf @@ -0,0 +1,15 @@ +# This file has some scaffolding to make sure that names are unique and that +# a region and zone are selected when you try to create your Terraform resources. + +locals { + name_suffix = "${random_pet.suffix.id}" +} + +resource "random_pet" "suffix" { + length = 2 +} + +provider "google" { + region = "us-central1" + zone = "us-central1-c" +} diff --git a/document_ai_warehouse_document_schema_property_enum/main.tf b/document_ai_warehouse_document_schema_property_enum/main.tf new file mode 100644 index 00000000..7c334c07 --- /dev/null +++ b/document_ai_warehouse_document_schema_property_enum/main.tf @@ -0,0 +1,48 @@ +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" { +} diff --git a/document_ai_warehouse_document_schema_property_enum/motd b/document_ai_warehouse_document_schema_property_enum/motd new file mode 100644 index 00000000..45a906e8 --- /dev/null +++ b/document_ai_warehouse_document_schema_property_enum/motd @@ -0,0 +1,7 @@ +=== + +These examples use real resources that will be billed to the +Google Cloud Platform project you use - so make sure that you +run "terraform destroy" before quitting! + +=== diff --git a/document_ai_warehouse_document_schema_property_enum/tutorial.md b/document_ai_warehouse_document_schema_property_enum/tutorial.md new file mode 100644 index 00000000..96a06e6d --- /dev/null +++ b/document_ai_warehouse_document_schema_property_enum/tutorial.md @@ -0,0 +1,79 @@ +# Document Ai Warehouse Document Schema Property Enum - Terraform + +## Setup + + + +Welcome to Terraform in Google Cloud Shell! We need you to let us know what project you'd like to use with Terraform. + + + +Terraform provisions real GCP resources, so anything you create in this session will be billed against this project. + +## Terraforming! + +Let's use {{project-id}} with Terraform! Click the Cloud Shell icon below to copy the command +to your shell, and then run it from the shell by pressing Enter/Return. Terraform will pick up +the project name from the environment variable. + +```bash +export GOOGLE_CLOUD_PROJECT={{project-id}} +``` + +After that, let's get Terraform started. Run the following to pull in the providers. + +```bash +terraform init +``` + +With the providers downloaded and a project set, you're ready to use Terraform. Go ahead! + +```bash +terraform apply +``` + +Terraform will show you what it plans to do, and prompt you to accept. Type "yes" to accept the plan. + +```bash +yes +``` + + +## Post-Apply + +### Editing your config + +Now you've provisioned your resources in GCP! If you run a "plan", you should see no changes needed. + +```bash +terraform plan +``` + +So let's make a change! Try editing a number, or appending a value to the name in the editor. Then, +run a 'plan' again. + +```bash +terraform plan +``` + +Afterwards you can run an apply, which implicitly does a plan and shows you the intended changes +at the 'yes' prompt. + +```bash +terraform apply +``` + +```bash +yes +``` + +## Cleanup + +Run the following to remove the resources Terraform provisioned: + +```bash +terraform destroy +``` +```bash +yes +``` diff --git a/document_ai_warehouse_document_schema_text/backing_file.tf b/document_ai_warehouse_document_schema_text/backing_file.tf new file mode 100644 index 00000000..c60b1199 --- /dev/null +++ b/document_ai_warehouse_document_schema_text/backing_file.tf @@ -0,0 +1,15 @@ +# This file has some scaffolding to make sure that names are unique and that +# a region and zone are selected when you try to create your Terraform resources. + +locals { + name_suffix = "${random_pet.suffix.id}" +} + +resource "random_pet" "suffix" { + length = 2 +} + +provider "google" { + region = "us-central1" + zone = "us-central1-c" +} diff --git a/document_ai_warehouse_document_schema_text/main.tf b/document_ai_warehouse_document_schema_text/main.tf new file mode 100644 index 00000000..7d593dbc --- /dev/null +++ b/document_ai_warehouse_document_schema_text/main.tf @@ -0,0 +1,25 @@ +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" { +} diff --git a/document_ai_warehouse_document_schema_text/motd b/document_ai_warehouse_document_schema_text/motd new file mode 100644 index 00000000..45a906e8 --- /dev/null +++ b/document_ai_warehouse_document_schema_text/motd @@ -0,0 +1,7 @@ +=== + +These examples use real resources that will be billed to the +Google Cloud Platform project you use - so make sure that you +run "terraform destroy" before quitting! + +=== diff --git a/document_ai_warehouse_document_schema_text/tutorial.md b/document_ai_warehouse_document_schema_text/tutorial.md new file mode 100644 index 00000000..eea250f2 --- /dev/null +++ b/document_ai_warehouse_document_schema_text/tutorial.md @@ -0,0 +1,79 @@ +# Document Ai Warehouse Document Schema Text - Terraform + +## Setup + + + +Welcome to Terraform in Google Cloud Shell! We need you to let us know what project you'd like to use with Terraform. + + + +Terraform provisions real GCP resources, so anything you create in this session will be billed against this project. + +## Terraforming! + +Let's use {{project-id}} with Terraform! Click the Cloud Shell icon below to copy the command +to your shell, and then run it from the shell by pressing Enter/Return. Terraform will pick up +the project name from the environment variable. + +```bash +export GOOGLE_CLOUD_PROJECT={{project-id}} +``` + +After that, let's get Terraform started. Run the following to pull in the providers. + +```bash +terraform init +``` + +With the providers downloaded and a project set, you're ready to use Terraform. Go ahead! + +```bash +terraform apply +``` + +Terraform will show you what it plans to do, and prompt you to accept. Type "yes" to accept the plan. + +```bash +yes +``` + + +## Post-Apply + +### Editing your config + +Now you've provisioned your resources in GCP! If you run a "plan", you should see no changes needed. + +```bash +terraform plan +``` + +So let's make a change! Try editing a number, or appending a value to the name in the editor. Then, +run a 'plan' again. + +```bash +terraform plan +``` + +Afterwards you can run an apply, which implicitly does a plan and shows you the intended changes +at the 'yes' prompt. + +```bash +terraform apply +``` + +```bash +yes +``` + +## Cleanup + +Run the following to remove the resources Terraform provisioned: + +```bash +terraform destroy +``` +```bash +yes +``` diff --git a/document_ai_warehouse_document_schema_timestamp/backing_file.tf b/document_ai_warehouse_document_schema_timestamp/backing_file.tf new file mode 100644 index 00000000..c60b1199 --- /dev/null +++ b/document_ai_warehouse_document_schema_timestamp/backing_file.tf @@ -0,0 +1,15 @@ +# This file has some scaffolding to make sure that names are unique and that +# a region and zone are selected when you try to create your Terraform resources. + +locals { + name_suffix = "${random_pet.suffix.id}" +} + +resource "random_pet" "suffix" { + length = 2 +} + +provider "google" { + region = "us-central1" + zone = "us-central1-c" +} diff --git a/document_ai_warehouse_document_schema_timestamp/main.tf b/document_ai_warehouse_document_schema_timestamp/main.tf new file mode 100644 index 00000000..8fe81999 --- /dev/null +++ b/document_ai_warehouse_document_schema_timestamp/main.tf @@ -0,0 +1,24 @@ +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" { +} diff --git a/document_ai_warehouse_document_schema_timestamp/motd b/document_ai_warehouse_document_schema_timestamp/motd new file mode 100644 index 00000000..45a906e8 --- /dev/null +++ b/document_ai_warehouse_document_schema_timestamp/motd @@ -0,0 +1,7 @@ +=== + +These examples use real resources that will be billed to the +Google Cloud Platform project you use - so make sure that you +run "terraform destroy" before quitting! + +=== diff --git a/document_ai_warehouse_document_schema_timestamp/tutorial.md b/document_ai_warehouse_document_schema_timestamp/tutorial.md new file mode 100644 index 00000000..7d7b8377 --- /dev/null +++ b/document_ai_warehouse_document_schema_timestamp/tutorial.md @@ -0,0 +1,79 @@ +# Document Ai Warehouse Document Schema Timestamp - Terraform + +## Setup + + + +Welcome to Terraform in Google Cloud Shell! We need you to let us know what project you'd like to use with Terraform. + + + +Terraform provisions real GCP resources, so anything you create in this session will be billed against this project. + +## Terraforming! + +Let's use {{project-id}} with Terraform! Click the Cloud Shell icon below to copy the command +to your shell, and then run it from the shell by pressing Enter/Return. Terraform will pick up +the project name from the environment variable. + +```bash +export GOOGLE_CLOUD_PROJECT={{project-id}} +``` + +After that, let's get Terraform started. Run the following to pull in the providers. + +```bash +terraform init +``` + +With the providers downloaded and a project set, you're ready to use Terraform. Go ahead! + +```bash +terraform apply +``` + +Terraform will show you what it plans to do, and prompt you to accept. Type "yes" to accept the plan. + +```bash +yes +``` + + +## Post-Apply + +### Editing your config + +Now you've provisioned your resources in GCP! If you run a "plan", you should see no changes needed. + +```bash +terraform plan +``` + +So let's make a change! Try editing a number, or appending a value to the name in the editor. Then, +run a 'plan' again. + +```bash +terraform plan +``` + +Afterwards you can run an apply, which implicitly does a plan and shows you the intended changes +at the 'yes' prompt. + +```bash +terraform apply +``` + +```bash +yes +``` + +## Cleanup + +Run the following to remove the resources Terraform provisioned: + +```bash +terraform destroy +``` +```bash +yes +``` diff --git a/document_ai_warehouse_location/backing_file.tf b/document_ai_warehouse_location/backing_file.tf new file mode 100644 index 00000000..c60b1199 --- /dev/null +++ b/document_ai_warehouse_location/backing_file.tf @@ -0,0 +1,15 @@ +# This file has some scaffolding to make sure that names are unique and that +# a region and zone are selected when you try to create your Terraform resources. + +locals { + name_suffix = "${random_pet.suffix.id}" +} + +resource "random_pet" "suffix" { + length = 2 +} + +provider "google" { + region = "us-central1" + zone = "us-central1-c" +} diff --git a/document_ai_warehouse_location/main.tf b/document_ai_warehouse_location/main.tf new file mode 100644 index 00000000..32e04826 --- /dev/null +++ b/document_ai_warehouse_location/main.tf @@ -0,0 +1,11 @@ +resource "google_document_ai_warehouse_location" "example" { + location = "us" + project_number = data.google_project.project.number + access_control_mode = "ACL_MODE_DOCUMENT_LEVEL_ACCESS_CONTROL_GCI" + database_type = "DB_INFRA_SPANNER" + kms_key = "dummy_key" + document_creator_default_role = "DOCUMENT_ADMIN" +} + +data "google_project" "project" { +} diff --git a/document_ai_warehouse_location/motd b/document_ai_warehouse_location/motd new file mode 100644 index 00000000..45a906e8 --- /dev/null +++ b/document_ai_warehouse_location/motd @@ -0,0 +1,7 @@ +=== + +These examples use real resources that will be billed to the +Google Cloud Platform project you use - so make sure that you +run "terraform destroy" before quitting! + +=== diff --git a/document_ai_warehouse_location/tutorial.md b/document_ai_warehouse_location/tutorial.md new file mode 100644 index 00000000..9ba14e0c --- /dev/null +++ b/document_ai_warehouse_location/tutorial.md @@ -0,0 +1,79 @@ +# Document Ai Warehouse Location - Terraform + +## Setup + + + +Welcome to Terraform in Google Cloud Shell! We need you to let us know what project you'd like to use with Terraform. + + + +Terraform provisions real GCP resources, so anything you create in this session will be billed against this project. + +## Terraforming! + +Let's use {{project-id}} with Terraform! Click the Cloud Shell icon below to copy the command +to your shell, and then run it from the shell by pressing Enter/Return. Terraform will pick up +the project name from the environment variable. + +```bash +export GOOGLE_CLOUD_PROJECT={{project-id}} +``` + +After that, let's get Terraform started. Run the following to pull in the providers. + +```bash +terraform init +``` + +With the providers downloaded and a project set, you're ready to use Terraform. Go ahead! + +```bash +terraform apply +``` + +Terraform will show you what it plans to do, and prompt you to accept. Type "yes" to accept the plan. + +```bash +yes +``` + + +## Post-Apply + +### Editing your config + +Now you've provisioned your resources in GCP! If you run a "plan", you should see no changes needed. + +```bash +terraform plan +``` + +So let's make a change! Try editing a number, or appending a value to the name in the editor. Then, +run a 'plan' again. + +```bash +terraform plan +``` + +Afterwards you can run an apply, which implicitly does a plan and shows you the intended changes +at the 'yes' prompt. + +```bash +terraform apply +``` + +```bash +yes +``` + +## Cleanup + +Run the following to remove the resources Terraform provisioned: + +```bash +terraform destroy +``` +```bash +yes +```