diff --git a/.changelog/16335.txt b/.changelog/16335.txt new file mode 100644 index 00000000000..cd01ed93107 --- /dev/null +++ b/.changelog/16335.txt @@ -0,0 +1,3 @@ +```release-note:new-resource +`google_vector_search_collection` +``` \ No newline at end of file diff --git a/.teamcity/components/inputs/services_beta.kt b/.teamcity/components/inputs/services_beta.kt index 05575eabbe3..a6827cb710c 100644 --- a/.teamcity/components/inputs/services_beta.kt +++ b/.teamcity/components/inputs/services_beta.kt @@ -861,6 +861,11 @@ var ServicesListBeta = mapOf( "displayName" to "Transcoder", "path" to "./google-beta/services/transcoder" ), + "vectorsearch" to mapOf( + "name" to "vectorsearch", + "displayName" to "VectorSearch", + "path" to "./google-beta/services/vectorsearch", + ), "vertexai" to mapOf( "name" to "vertexai", "displayName" to "Vertexai", diff --git a/.teamcity/components/inputs/services_ga.kt b/.teamcity/components/inputs/services_ga.kt index c8d98cd69b6..cd41de179d5 100644 --- a/.teamcity/components/inputs/services_ga.kt +++ b/.teamcity/components/inputs/services_ga.kt @@ -856,6 +856,11 @@ var ServicesListGa = mapOf( "displayName" to "Transcoder", "path" to "./google/services/transcoder" ), + "vectorsearch" to mapOf( + "name" to "vectorsearch", + "displayName" to "VectorSearch", + "path" to "./google/services/vectorsearch", + ), "vertexai" to mapOf( "name" to "vertexai", "displayName" to "Vertexai", diff --git a/google/services/vectorsearch/resource_vector_search_collection_test.go b/google/services/vectorsearch/resource_vector_search_collection_test.go new file mode 100644 index 00000000000..be4feb6fbdd --- /dev/null +++ b/google/services/vectorsearch/resource_vector_search_collection_test.go @@ -0,0 +1,17 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 +// ---------------------------------------------------------------------------- +// +// *** AUTO GENERATED CODE *** Type: Handwritten *** +// +// ---------------------------------------------------------------------------- +// +// This code is generated by Magic Modules using the following: +// +// Source file: https://github.com/GoogleCloudPlatform/magic-modules/tree/main/mmv1/third_party/terraform/services/vectorsearch/resource_vector_search_collection_test.go.tmpl +// +// DO NOT EDIT this file directly. Any changes made to this file will be +// overwritten during the next generation cycle. +// +// ---------------------------------------------------------------------------- +package vectorsearch_test diff --git a/website/docs/r/vector_search_collection.html.markdown b/website/docs/r/vector_search_collection.html.markdown new file mode 100644 index 00000000000..acf295ad12e --- /dev/null +++ b/website/docs/r/vector_search_collection.html.markdown @@ -0,0 +1,246 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** Type: MMv1 *** +# +# ---------------------------------------------------------------------------- +# +# This code is generated by Magic Modules using the following: +# +# Configuration: https:#github.com/GoogleCloudPlatform/magic-modules/tree/main/mmv1/products/vectorsearch/Collection.yaml +# Template: https:#github.com/GoogleCloudPlatform/magic-modules/tree/main/mmv1/templates/terraform/resource.html.markdown.tmpl +# +# DO NOT EDIT this file directly. Any changes made to this file will be +# overwritten during the next generation cycle. +# +# ---------------------------------------------------------------------------- +subcategory: "Vector Search" +description: |- + Description +--- + +# google_vector_search_collection + +Description + +~> **Warning:** This resource is in beta, and should be used with the terraform-provider-google-beta provider. +See [Provider Versions](../guides/provider_versions.html.markdown) for more details on beta resources. + + +
+ + Open in Cloud Shell + +
+## Example Usage - Vectorsearch Collection Basic + + +```hcl +resource "google_vector_search_collection" "example-collection" { + provider = google-beta + + location = "us-central1" + collection_id = "example-collection" + + display_name = "My Awesome Collection" + description = "This collection stores important data." + + labels = { + env = "dev" + team = "my-team" + } + + data_schema = <The `vector_schema` block supports: + +* `field_name` - (Required) The identifier for this object. Format specified above. + +* `dense_vector` - + (Optional) + Message describing a dense vector field. + Structure is [documented below](#nested_vector_schema_dense_vector). + +* `sparse_vector` - + (Optional) + Message describing a sparse vector field. + + +The `dense_vector` block supports: + +* `dimensions` - + (Optional) + Dimensionality of the vector field. + +* `vertex_embedding_config` - + (Optional) + Message describing the configuration for generating embeddings for a vector + field using Vertex AI embeddings API. + Structure is [documented below](#nested_vector_schema_dense_vector_vertex_embedding_config). + + +The `vertex_embedding_config` block supports: + +* `model_id` - + (Required) + Required: ID of the embedding model to use. See + https://cloud.google.com/vertex-ai/generative-ai/docs/learn/models#embeddings-models + for the list of supported models. + +* `task_type` - + (Required) + Possible values: + RETRIEVAL_QUERY + RETRIEVAL_DOCUMENT + SEMANTIC_SIMILARITY + CLASSIFICATION + CLUSTERING + QUESTION_ANSWERING + FACT_VERIFICATION + CODE_RETRIEVAL_QUERY + +* `text_template` - + (Required) + Required: Text template for the input to the model. The template must + contain one or more references to fields in the DataObject, e.g.: + "Movie Title: {title} ---- Movie Plot: {plot}". + +## 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/{{collection_id}}` + +* `create_time` - + [Output only] Create time stamp + +* `name` - + Identifier. name of resource + +* `update_time` - + [Output only] Update time stamp + +* `terraform_labels` - + The combination of labels configured directly on the resource + and default labels configured on the provider. + +* `effective_labels` - + All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Terraform, other clients and services. + + +## 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. +- `update` - Default is 20 minutes. +- `delete` - Default is 20 minutes. + +## Import + + +Collection can be imported using any of these accepted formats: + +* `projects/{{project}}/locations/{{location}}/collections/{{collection_id}}` +* `{{project}}/{{location}}/{{collection_id}}` +* `{{location}}/{{collection_id}}` + + +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import Collection using one of the formats above. For example: + +```tf +import { + id = "projects/{{project}}/locations/{{location}}/collections/{{collection_id}}" + to = google_vector_search_collection.default +} +``` + +When using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import), Collection can be imported using one of the formats above. For example: + +``` +$ terraform import google_vector_search_collection.default projects/{{project}}/locations/{{location}}/collections/{{collection_id}} +$ terraform import google_vector_search_collection.default {{project}}/{{location}}/{{collection_id}} +$ terraform import google_vector_search_collection.default {{location}}/{{collection_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).