Collection class

Description

Example Usage

Vectorsearch Collection Basic

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const example_collection = new gcp.vectorsearch.Collection("example-collection", {
    location: "us-central1",
    collectionId: "example-collection",
    displayName: "My Awesome Collection",
    description: "This collection stores important data.",
    labels: {
        env: "dev",
        team: "my-team",
    },
    dataSchema: `{
  \\"type\\": \\"object\\",
  \\"properties\\": {
    \\"title\\": {
      \\"type\\": \\"string\\"
    },
    \\"plot\\": {
      \\"type\\": \\"string\\"
    }
  }
}
`,
    vectorSchemas: [{
        fieldName: "text_embedding",
        denseVector: {
            dimensions: 768,
            vertexEmbeddingConfig: {
                modelId: "textembedding-gecko@003",
                taskType: "RETRIEVAL_DOCUMENT",
                textTemplate: "Title: {title} ---- Plot: {plot}",
            },
        },
    }],
});
import pulumi
import pulumi_gcp as gcp

example_collection = gcp.vectorsearch.Collection("example-collection",
    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="""{
  \"type\": \"object\",
  \"properties\": {
    \"title\": {
      \"type\": \"string\"
    },
    \"plot\": {
      \"type\": \"string\"
    }
  }
}
""",
    vector_schemas=[{
        "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}",
            },
        },
    }])
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() =>
{
    var example_collection = new Gcp.VectorSearch.Collection("example-collection", new()
    {
        Location = "us-central1",
        CollectionId = "example-collection",
        DisplayName = "My Awesome Collection",
        Description = "This collection stores important data.",
        Labels =
        {
            { "env", "dev" },
            { "team", "my-team" },
        },
        DataSchema = @"{
  \""type\"": \""object\"",
  \""properties\"": {
    \""title\"": {
      \""type\"": \""string\""
    },
    \""plot\"": {
      \""type\"": \""string\""
    }
  }
}
",
        VectorSchemas = new[]
        {
            new Gcp.VectorSearch.Inputs.CollectionVectorSchemaArgs
            {
                FieldName = "text_embedding",
                DenseVector = new Gcp.VectorSearch.Inputs.CollectionVectorSchemaDenseVectorArgs
                {
                    Dimensions = 768,
                    VertexEmbeddingConfig = new Gcp.VectorSearch.Inputs.CollectionVectorSchemaDenseVectorVertexEmbeddingConfigArgs
                    {
                        ModelId = "textembedding-gecko@003",
                        TaskType = "RETRIEVAL_DOCUMENT",
                        TextTemplate = "Title: {title} ---- Plot: {plot}",
                    },
                },
            },
        },
    });

});
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/vectorsearch"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := vectorsearch.NewCollection(ctx, "example-collection", &vectorsearch.CollectionArgs{
			Location:     pulumi.String("us-central1"),
			CollectionId: pulumi.String("example-collection"),
			DisplayName:  pulumi.String("My Awesome Collection"),
			Description:  pulumi.String("This collection stores important data."),
			Labels: pulumi.StringMap{
				"env":  pulumi.String("dev"),
				"team": pulumi.String("my-team"),
			},
			DataSchema: pulumi.String(`{
  \"type\": \"object\",
  \"properties\": {
    \"title\": {
      \"type\": \"string\"
    },
    \"plot\": {
      \"type\": \"string\"
    }
  }
}
`),
			VectorSchemas: vectorsearch.CollectionVectorSchemaArray{
				&vectorsearch.CollectionVectorSchemaArgs{
					FieldName: pulumi.String("text_embedding"),
					DenseVector: &vectorsearch.CollectionVectorSchemaDenseVectorArgs{
						Dimensions: pulumi.Int(768),
						VertexEmbeddingConfig: &vectorsearch.CollectionVectorSchemaDenseVectorVertexEmbeddingConfigArgs{
							ModelId:      pulumi.String("textembedding-gecko@003"),
							TaskType:     pulumi.String("RETRIEVAL_DOCUMENT"),
							TextTemplate: pulumi.String("Title: {title} ---- Plot: {plot}"),
						},
					},
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    gcp = {
      source = "pulumi/gcp"
    }
  }
}

resource "gcp_vectorsearch_collection" "example-collection" {
  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 = "{\n  \\\"type\\\": \\\"object\\\",\n  \\\"properties\\\": {\n    \\\"title\\\": {\n      \\\"type\\\": \\\"string\\\"\n    },\n    \\\"plot\\\": {\n      \\\"type\\\": \\\"string\\\"\n    }\n  }\n}\n"
  vector_schemas {
    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}"
      }
    }
  }
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.vectorsearch.Collection;
import com.pulumi.gcp.vectorsearch.CollectionArgs;
import com.pulumi.gcp.vectorsearch.inputs.CollectionVectorSchemaArgs;
import com.pulumi.gcp.vectorsearch.inputs.CollectionVectorSchemaDenseVectorArgs;
import com.pulumi.gcp.vectorsearch.inputs.CollectionVectorSchemaDenseVectorVertexEmbeddingConfigArgs;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var example_collection = new Collection("example-collection", CollectionArgs.builder()
            .location("us-central1")
            .collectionId("example-collection")
            .displayName("My Awesome Collection")
            .description("This collection stores important data.")
            .labels(Map.ofEntries(
                Map.entry("env", "dev"),
                Map.entry("team", "my-team")
            ))
            .dataSchema("""
{
  \"type\": \"object\",
  \"properties\": {
    \"title\": {
      \"type\": \"string\"
    },
    \"plot\": {
      \"type\": \"string\"
    }
  }
}
            """)
            .vectorSchemas(CollectionVectorSchemaArgs.builder()
                .fieldName("text_embedding")
                .denseVector(CollectionVectorSchemaDenseVectorArgs.builder()
                    .dimensions(768)
                    .vertexEmbeddingConfig(CollectionVectorSchemaDenseVectorVertexEmbeddingConfigArgs.builder()
                        .modelId("textembedding-gecko@003")
                        .taskType("RETRIEVAL_DOCUMENT")
                        .textTemplate("Title: {title} ---- Plot: {plot}")
                        .build())
                    .build())
                .build())
            .build());

    }
}
resources:
  example-collection:
    type: gcp:vectorsearch:Collection
    properties:
      location: us-central1
      collectionId: example-collection
      displayName: My Awesome Collection
      description: This collection stores important data.
      labels:
        env: dev
        team: my-team
      dataSchema: |
        {
          \"type\": \"object\",
          \"properties\": {
            \"title\": {
              \"type\": \"string\"
            },
            \"plot\": {
              \"type\": \"string\"
            }
          }
        }
      vectorSchemas:
        - fieldName: text_embedding
          denseVector:
            dimensions: 768
            vertexEmbeddingConfig:
              modelId: textembedding-gecko@003
              taskType: RETRIEVAL_DOCUMENT
              textTemplate: 'Title: {title} ---- Plot: {plot}'

Vectorsearch Collection Cmek

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const keyRing = new gcp.kms.KeyRing("key_ring", {
    name: "example-cmek-collection",
    location: "us-central1",
});
const cryptoKey = new gcp.kms.CryptoKey("crypto_key", {
    name: "example-cmek-collection",
    keyRing: keyRing.id,
});
const project = gcp.organizations.getProject({});
const cryptoKeyMemberVsSa = new gcp.kms.CryptoKeyIAMMember("crypto_key_member_vs_sa", {
    cryptoKeyId: cryptoKey.id,
    role: "roles/cloudkms.cryptoKeyEncrypterDecrypter",
    member: project.then(project => `serviceAccount:service-${project.number}@gcp-sa-vectorsearch.iam.gserviceaccount.com`),
});
const example_cmek_collection = new gcp.vectorsearch.Collection("example-cmek-collection", {
    location: "us-central1",
    collectionId: "example-cmek-collection",
    displayName: "My Awesome Encrypted Collection",
    description: "This collection stores important data.",
    encryptionSpec: {
        cryptoKeyName: cryptoKey.id,
    },
    labels: {
        env: "dev",
        team: "my-team",
    },
    dataSchema: `{
  \\"type\\": \\"object\\",
  \\"properties\\": {
    \\"title\\": {
      \\"type\\": \\"string\\"
    },
    \\"plot\\": {
      \\"type\\": \\"string\\"
    }
  }
}
`,
    vectorSchemas: [{
        fieldName: "text_embedding",
        denseVector: {
            dimensions: 768,
            vertexEmbeddingConfig: {
                modelId: "textembedding-gecko@003",
                taskType: "RETRIEVAL_DOCUMENT",
                textTemplate: "Title: {title} ---- Plot: {plot}",
            },
        },
    }],
}, {
    dependsOn: [cryptoKeyMemberVsSa],
});
import pulumi
import pulumi_gcp as gcp

key_ring = gcp.kms.KeyRing("key_ring",
    name="example-cmek-collection",
    location="us-central1")
crypto_key = gcp.kms.CryptoKey("crypto_key",
    name="example-cmek-collection",
    key_ring=key_ring.id)
project = gcp.organizations.get_project()
crypto_key_member_vs_sa = gcp.kms.CryptoKeyIAMMember("crypto_key_member_vs_sa",
    crypto_key_id=crypto_key.id,
    role="roles/cloudkms.cryptoKeyEncrypterDecrypter",
    member=f"serviceAccount:service-{project.number}@gcp-sa-vectorsearch.iam.gserviceaccount.com")
example_cmek_collection = gcp.vectorsearch.Collection("example-cmek-collection",
    location="us-central1",
    collection_id="example-cmek-collection",
    display_name="My Awesome Encrypted Collection",
    description="This collection stores important data.",
    encryption_spec={
        "crypto_key_name": crypto_key.id,
    },
    labels={
        "env": "dev",
        "team": "my-team",
    },
    data_schema="""{
  \"type\": \"object\",
  \"properties\": {
    \"title\": {
      \"type\": \"string\"
    },
    \"plot\": {
      \"type\": \"string\"
    }
  }
}
""",
    vector_schemas=[{
        "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}",
            },
        },
    }],
    opts = pulumi.ResourceOptions(depends_on=[crypto_key_member_vs_sa]))
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() =>
{
    var keyRing = new Gcp.Kms.KeyRing("key_ring", new()
    {
        Name = "example-cmek-collection",
        Location = "us-central1",
    });

    var cryptoKey = new Gcp.Kms.CryptoKey("crypto_key", new()
    {
        Name = "example-cmek-collection",
        KeyRing = keyRing.Id,
    });

    var project = Gcp.Organizations.GetProject.Invoke();

    var cryptoKeyMemberVsSa = new Gcp.Kms.CryptoKeyIAMMember("crypto_key_member_vs_sa", new()
    {
        CryptoKeyId = cryptoKey.Id,
        Role = "roles/cloudkms.cryptoKeyEncrypterDecrypter",
        Member = $"serviceAccount:service-{project.Apply(getProjectResult => getProjectResult.Number)}@gcp-sa-vectorsearch.iam.gserviceaccount.com",
    });

    var example_cmek_collection = new Gcp.VectorSearch.Collection("example-cmek-collection", new()
    {
        Location = "us-central1",
        CollectionId = "example-cmek-collection",
        DisplayName = "My Awesome Encrypted Collection",
        Description = "This collection stores important data.",
        EncryptionSpec = new Gcp.VectorSearch.Inputs.CollectionEncryptionSpecArgs
        {
            CryptoKeyName = cryptoKey.Id,
        },
        Labels =
        {
            { "env", "dev" },
            { "team", "my-team" },
        },
        DataSchema = @"{
  \""type\"": \""object\"",
  \""properties\"": {
    \""title\"": {
      \""type\"": \""string\""
    },
    \""plot\"": {
      \""type\"": \""string\""
    }
  }
}
",
        VectorSchemas = new[]
        {
            new Gcp.VectorSearch.Inputs.CollectionVectorSchemaArgs
            {
                FieldName = "text_embedding",
                DenseVector = new Gcp.VectorSearch.Inputs.CollectionVectorSchemaDenseVectorArgs
                {
                    Dimensions = 768,
                    VertexEmbeddingConfig = new Gcp.VectorSearch.Inputs.CollectionVectorSchemaDenseVectorVertexEmbeddingConfigArgs
                    {
                        ModelId = "textembedding-gecko@003",
                        TaskType = "RETRIEVAL_DOCUMENT",
                        TextTemplate = "Title: {title} ---- Plot: {plot}",
                    },
                },
            },
        },
    }, new CustomResourceOptions
    {
        DependsOn =
        {
            cryptoKeyMemberVsSa,
        },
    });

});
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/kms"
	"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/organizations"
	"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/vectorsearch"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		keyRing, err := kms.NewKeyRing(ctx, "key_ring", &kms.KeyRingArgs{
			Name:     pulumi.String("example-cmek-collection"),
			Location: pulumi.String("us-central1"),
		})
		if err != nil {
			return err
		}
		cryptoKey, err := kms.NewCryptoKey(ctx, "crypto_key", &kms.CryptoKeyArgs{
			Name:    pulumi.String("example-cmek-collection"),
			KeyRing: keyRing.ID().ToIDOutput().ToStringOutput(),
		})
		if err != nil {
			return err
		}
		project, err := organizations.LookupProject(ctx, &organizations.LookupProjectArgs{}, nil)
		if err != nil {
			return err
		}
		cryptoKeyMemberVsSa, err := kms.NewCryptoKeyIAMMember(ctx, "crypto_key_member_vs_sa", &kms.CryptoKeyIAMMemberArgs{
			CryptoKeyId: cryptoKey.ID().ToIDOutput().ToStringOutput(),
			Role:        pulumi.String("roles/cloudkms.cryptoKeyEncrypterDecrypter"),
			Member:      pulumi.Sprintf("serviceAccount:service-%v@gcp-sa-vectorsearch.iam.gserviceaccount.com", project.Number),
		})
		if err != nil {
			return err
		}
		_, err = vectorsearch.NewCollection(ctx, "example-cmek-collection", &vectorsearch.CollectionArgs{
			Location:     pulumi.String("us-central1"),
			CollectionId: pulumi.String("example-cmek-collection"),
			DisplayName:  pulumi.String("My Awesome Encrypted Collection"),
			Description:  pulumi.String("This collection stores important data."),
			EncryptionSpec: &vectorsearch.CollectionEncryptionSpecArgs{
				CryptoKeyName: cryptoKey.ID().ToIDOutput().ToStringOutput(),
			},
			Labels: pulumi.StringMap{
				"env":  pulumi.String("dev"),
				"team": pulumi.String("my-team"),
			},
			DataSchema: pulumi.String(`{
  \"type\": \"object\",
  \"properties\": {
    \"title\": {
      \"type\": \"string\"
    },
    \"plot\": {
      \"type\": \"string\"
    }
  }
}
`),
			VectorSchemas: vectorsearch.CollectionVectorSchemaArray{
				&vectorsearch.CollectionVectorSchemaArgs{
					FieldName: pulumi.String("text_embedding"),
					DenseVector: &vectorsearch.CollectionVectorSchemaDenseVectorArgs{
						Dimensions: pulumi.Int(768),
						VertexEmbeddingConfig: &vectorsearch.CollectionVectorSchemaDenseVectorVertexEmbeddingConfigArgs{
							ModelId:      pulumi.String("textembedding-gecko@003"),
							TaskType:     pulumi.String("RETRIEVAL_DOCUMENT"),
							TextTemplate: pulumi.String("Title: {title} ---- Plot: {plot}"),
						},
					},
				},
			},
		}, pulumi.DependsOn([]pulumi.Resource{
			cryptoKeyMemberVsSa,
		}))
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    gcp = {
      source = "pulumi/gcp"
    }
  }
}

data "gcp_organizations_getproject" "project" {
}

resource "gcp_vectorsearch_collection" "example-cmek-collection" {
  depends_on    = [gcp_kms_cryptokeyiammember.crypto_key_member_vs_sa]
  location      = "us-central1"
  collection_id = "example-cmek-collection"
  display_name  = "My Awesome Encrypted Collection"
  description   = "This collection stores important data."
  encryption_spec = {
    crypto_key_name = gcp_kms_cryptokey.crypto_key.id
  }
  labels = {
    "env"  = "dev"
    "team" = "my-team"
  }
  data_schema = "{\n  \\\"type\\\": \\\"object\\\",\n  \\\"properties\\\": {\n    \\\"title\\\": {\n      \\\"type\\\": \\\"string\\\"\n    },\n    \\\"plot\\\": {\n      \\\"type\\\": \\\"string\\\"\n    }\n  }\n}\n"
  vector_schemas {
    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}"
      }
    }
  }
}
resource "gcp_kms_cryptokey" "crypto_key" {
  name     = "example-cmek-collection"
  key_ring = gcp_kms_keyring.key_ring.id
}
resource "gcp_kms_keyring" "key_ring" {
  name     = "example-cmek-collection"
  location = "us-central1"
}
resource "gcp_kms_cryptokeyiammember" "crypto_key_member_vs_sa" {
  crypto_key_id = gcp_kms_cryptokey.crypto_key.id
  role          = "roles/cloudkms.cryptoKeyEncrypterDecrypter"
  member        ="serviceAccount:service-${data.gcp_organizations_getproject.project.number}@gcp-sa-vectorsearch.iam.gserviceaccount.com"
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.kms.KeyRing;
import com.pulumi.gcp.kms.KeyRingArgs;
import com.pulumi.gcp.kms.CryptoKey;
import com.pulumi.gcp.kms.CryptoKeyArgs;
import com.pulumi.gcp.organizations.OrganizationsFunctions;
import com.pulumi.gcp.organizations.inputs.GetProjectArgs;
import com.pulumi.gcp.kms.CryptoKeyIAMMember;
import com.pulumi.gcp.kms.CryptoKeyIAMMemberArgs;
import com.pulumi.gcp.vectorsearch.Collection;
import com.pulumi.gcp.vectorsearch.CollectionArgs;
import com.pulumi.gcp.vectorsearch.inputs.CollectionEncryptionSpecArgs;
import com.pulumi.gcp.vectorsearch.inputs.CollectionVectorSchemaArgs;
import com.pulumi.gcp.vectorsearch.inputs.CollectionVectorSchemaDenseVectorArgs;
import com.pulumi.gcp.vectorsearch.inputs.CollectionVectorSchemaDenseVectorVertexEmbeddingConfigArgs;
import com.pulumi.resources.CustomResourceOptions;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var keyRing = new KeyRing("keyRing", KeyRingArgs.builder()
            .name("example-cmek-collection")
            .location("us-central1")
            .build());

        var cryptoKey = new CryptoKey("cryptoKey", CryptoKeyArgs.builder()
            .name("example-cmek-collection")
            .keyRing(keyRing.id())
            .build());

        final var project = OrganizationsFunctions.getProject(GetProjectArgs.builder()
            .build());

        var cryptoKeyMemberVsSa = new CryptoKeyIAMMember("cryptoKeyMemberVsSa", CryptoKeyIAMMemberArgs.builder()
            .cryptoKeyId(cryptoKey.id())
            .role("roles/cloudkms.cryptoKeyEncrypterDecrypter")
            .member(String.format("serviceAccount:service-%s@gcp-sa-vectorsearch.iam.gserviceaccount.com", project.number()))
            .build());

        var example_cmek_collection = new Collection("example-cmek-collection", CollectionArgs.builder()
            .location("us-central1")
            .collectionId("example-cmek-collection")
            .displayName("My Awesome Encrypted Collection")
            .description("This collection stores important data.")
            .encryptionSpec(CollectionEncryptionSpecArgs.builder()
                .cryptoKeyName(cryptoKey.id())
                .build())
            .labels(Map.ofEntries(
                Map.entry("env", "dev"),
                Map.entry("team", "my-team")
            ))
            .dataSchema("""
{
  \"type\": \"object\",
  \"properties\": {
    \"title\": {
      \"type\": \"string\"
    },
    \"plot\": {
      \"type\": \"string\"
    }
  }
}
            """)
            .vectorSchemas(CollectionVectorSchemaArgs.builder()
                .fieldName("text_embedding")
                .denseVector(CollectionVectorSchemaDenseVectorArgs.builder()
                    .dimensions(768)
                    .vertexEmbeddingConfig(CollectionVectorSchemaDenseVectorVertexEmbeddingConfigArgs.builder()
                        .modelId("textembedding-gecko@003")
                        .taskType("RETRIEVAL_DOCUMENT")
                        .textTemplate("Title: {title} ---- Plot: {plot}")
                        .build())
                    .build())
                .build())
            .build(), CustomResourceOptions.builder()
                .dependsOn(cryptoKeyMemberVsSa)
                .build());

    }
}
resources:
  example-cmek-collection:
    type: gcp:vectorsearch:Collection
    properties:
      location: us-central1
      collectionId: example-cmek-collection
      displayName: My Awesome Encrypted Collection
      description: This collection stores important data.
      encryptionSpec:
        cryptoKeyName: ${cryptoKey.id}
      labels:
        env: dev
        team: my-team
      dataSchema: |
        {
          \"type\": \"object\",
          \"properties\": {
            \"title\": {
              \"type\": \"string\"
            },
            \"plot\": {
              \"type\": \"string\"
            }
          }
        }
      vectorSchemas:
        - fieldName: text_embedding
          denseVector:
            dimensions: 768
            vertexEmbeddingConfig:
              modelId: textembedding-gecko@003
              taskType: RETRIEVAL_DOCUMENT
              textTemplate: 'Title: {title} ---- Plot: {plot}'
    options:
      dependsOn:
        - ${cryptoKeyMemberVsSa}
  cryptoKey:
    type: gcp:kms:CryptoKey
    name: crypto_key
    properties:
      name: example-cmek-collection
      keyRing: ${keyRing.id}
  keyRing:
    type: gcp:kms:KeyRing
    name: key_ring
    properties:
      name: example-cmek-collection
      location: us-central1
  cryptoKeyMemberVsSa:
    type: gcp:kms:CryptoKeyIAMMember
    name: crypto_key_member_vs_sa
    properties:
      cryptoKeyId: ${cryptoKey.id}
      role: roles/cloudkms.cryptoKeyEncrypterDecrypter
      member: serviceAccount:service-${project.number}@gcp-sa-vectorsearch.iam.gserviceaccount.com
variables:
  project:
    fn::invoke:
      function: gcp:organizations:getProject
      arguments: {}

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}}

When using the pulumi import command, Collection can be imported using one of the formats above. For example:

$ pulumi import gcp:vectorsearch/collection:Collection default projects/{{project}}/locations/{{location}}/collections/{{collection_id}}
$ pulumi import gcp:vectorsearch/collection:Collection default {{project}}/{{location}}/{{collection_id}}
$ pulumi import gcp:vectorsearch/collection:Collection default {{location}}/{{collection_id}}

Constructors

Collection(String name, {CollectionArgs? args, CustomResourceOptions? options})
Creates a new Collection. name The Pulumi resource name. args Arguments used to configure this Collection. The set of arguments for Collection. options Resource options controlling this resource's behavior.
Collection.reference(String urn)
Creates a typed reference to an existing Collection resource.

Properties

childResources → Set<Resource>
finalinherited
collectionId ↔ Output<String>
ID of the Collection to create. The id must be 1-63 characters long, and comply with RFC1035. Specifically, it must be 1-63 characters long and match the regular expression a-z?.
latefinal
completionSources ↔ Map<String, IOutputCompletionSource>
latefinalinherited
createTime ↔ Output<String>
Output only Create time stamp
latefinal
dataSchema ↔ Output<String?>
JSON Schema for data. Field names must contain only alphanumeric characters, underscores, and hyphens.
latefinal
deletionPolicy ↔ Output<String>
Whether Terraform will be prevented from destroying the resource. Defaults to DELETE. When a 'terraform destroy' or 'pulumi up' would delete the resource, the command will fail if this field is set to "PREVENT" in Terraform state. When set to "ABANDON", the command will remove the resource from Terraform management without updating or deleting the resource in the API. When set to "DELETE", deleting the resource is allowed.
latefinal
description ↔ Output<String?>
User-specified description of the collection
latefinal
displayName ↔ Output<String?>
User-specified display name of the collection
latefinal
effectiveLabels ↔ Output<Map<String, String>>
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
latefinal
encryptionSpec ↔ Output<CollectionEncryptionSpec?>
Represents a customer-managed encryption key specification that can be applied to a Vector Search collection. Structure is documented below.
latefinal
hashCode → int
The hash code for this object.
no setterinherited
id ↔ Output<String>
getter/setter pairinherited
isCustom → bool
Returns whether this resource is provider-managed.
no setterinherited
isProtected → bool
Returns whether this resource is protected from deletion.
no setterinherited
isRemote → bool
Whether this resource is registered as remote.
no setterinherited
isResourceReference → bool
Whether this instance represents a resource value returned over RPC.
finalinherited
labels ↔ Output<Map<String, String>?>
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 effectiveLabels for all of the labels present on the resource.
latefinal
location ↔ Output<String>
Resource ID segment making up resource name. It identifies the resource within its parent collection as described in https://google.aip.dev/122.
latefinal
name ↔ Output<String>
Identifier. name of resource
latefinal
project ↔ Output<String>
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
latefinal
pulumiLabels ↔ Output<Map<String, String>>
The combination of labels configured directly on the resource and default labels configured on the provider.
latefinal
resourceTransforms → List<ResourceTransform>
Inherited/explicit async transforms.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
transformations → List<ResourceTransformation>
Inherited/explicit legacy transformations.
no setterinherited
updateTime ↔ Output<String>
Output only Update time stamp
latefinal
urn ↔ Output<String>
latefinalinherited
vectorSchemas ↔ Output<List<CollectionVectorSchema>?>
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.
latefinal

Methods

failId(Object error) → void
Completes this resource ID with an error when registration fails.
inherited
failOutputs(Object error) → void
Completes all output properties with error.
inherited
failUrn(Object error) → void
Completes this resource URN with an error when registration fails.
inherited
getProvider(String moduleMember) → ProviderResource?
Returns provider for moduleMember's package, if configured.
inherited
getResourceName() → String
Returns this resource's logical name.
inherited
getResourceType() → String
Returns this resource's Pulumi type token.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerOutput<T>(String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output<T>
Registers a dynamic output property for this resource.
inherited
resolveId(String? value, {required bool isKnown}) → void
Resolves the provider-assigned ID for this resource.
inherited
resolveOutputs(Struct outputs) → void
Resolves all output properties from a monitor response payload.
inherited
resolveUrn(String value) → void
Resolves this resource's URN once assigned by the engine.
inherited
serializeProperties(Map<String, dynamic> properties) → Future<Struct>
Serializes resource properties for RPC transmission.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

get(String name, Input<String> id, {CollectionState? state, CustomResourceOptions? options}) → Collection
Gets an existing Collection resource's state with the given name and id.