Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/16335.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:new-resource
`google_vector_search_collection`
```
5 changes: 5 additions & 0 deletions .teamcity/components/inputs/services_beta.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
5 changes: 5 additions & 0 deletions .teamcity/components/inputs/services_ga.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
@@ -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
246 changes: 246 additions & 0 deletions website/docs/r/vector_search_collection.html.markdown
Original file line number Diff line number Diff line change
@@ -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.


<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=vectorsearch_collection_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 - 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 = <<EOF
{
"type": "object",
"properties": {
"title": {
"type": "string"
},
"plot": {
"type": "string"
}
}
}
EOF

vector_schema {
field_name = "text_embedding"
dense_vector {
dimensions = 768
vertex_embedding_config {
model_id = "textembedding-gecko@003"
task_type = "RETRIEVAL_DOCUMENT"
text_template = "Title: {title} ---- Plot: {plot}"
}
}
}
}
```

## Argument Reference

The following arguments are supported:


* `location` -
(Required)
Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122.

* `collection_id` -
(Required)
ID of the Collection to create.
The id must be 1-63 characters long, and comply with
[RFC1035](https://www.ietf.org/rfc/rfc1035.txt).
Specifically, it must be 1-63 characters long and match the regular
expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?`.


* `data_schema` -
(Optional)
JSON Schema for data.
Field names must contain only alphanumeric characters,
underscores, and hyphens.

* `description` -
(Optional)
User-specified description of the collection

* `display_name` -
(Optional)
User-specified display name of the collection

* `labels` -
(Optional)
Labels as key value pairs.
**Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
Please refer to the field `effective_labels` for all of the labels present on the resource.

* `vector_schema` -
(Optional)
Schema for vector fields. Only vector fields in this schema will be
searchable.
Field names must contain only alphanumeric characters,
underscores, and hyphens.
Structure is [documented below](#nested_vector_schema).

* `project` - (Optional) The ID of the project in which the resource belongs.
If it is not provided, the provider project is used.



<a name="nested_vector_schema"></a>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.


<a name="nested_vector_schema_dense_vector"></a>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).


<a name="nested_vector_schema_dense_vector_vertex_embedding_config"></a>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).
Loading