@pulumi/databricks
Version:
A Pulumi package for creating and managing databricks cloud resources.
121 lines • 5.07 kB
JavaScript
;
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.VectorSearchIndex = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* This resource allows you to create [Mosaic AI Vector Search Index](https://docs.databricks.com/en/generative-ai/create-query-vector-search.html) in Databricks. Mosaic AI Vector Search is a serverless similarity search engine that allows you to store a vector representation of your data, including metadata, in a vector database. The Mosaic AI Vector Search Index provides the ability to search data in the linked Delta Table.
*
* > This resource can only be used with a workspace-level provider!
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as databricks from "@pulumi/databricks";
*
* const sync = new databricks.VectorSearchIndex("sync", {
* name: "main.default.vector_search_index",
* endpointName: thisDatabricksVectorSearchEndpoint.name,
* primaryKey: "id",
* indexType: "DELTA_SYNC",
* deltaSyncIndexSpec: {
* sourceTable: "main.default.source_table",
* pipelineType: "TRIGGERED",
* embeddingSourceColumns: [{
* name: "text",
* embeddingModelEndpointName: _this.name,
* }],
* },
* });
* ```
*
* ## Import
*
* The resource can be imported using the name of the Mosaic AI Vector Search Index:
*
* hcl
*
* import {
*
* to = databricks_vector_search_index.this
*
* id = "<index-name>"
*
* }
*
* Alternatively, when using `terraform` version 1.4 or earlier, import using the `pulumi import` command:
*
* bash
*
* ```sh
* $ pulumi import databricks:index/vectorSearchIndex:VectorSearchIndex this <index-name>
* ```
*/
class VectorSearchIndex extends pulumi.CustomResource {
/**
* Get an existing VectorSearchIndex resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name, id, state, opts) {
return new VectorSearchIndex(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of VectorSearchIndex. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === VectorSearchIndex.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["creator"] = state?.creator;
resourceInputs["deltaSyncIndexSpec"] = state?.deltaSyncIndexSpec;
resourceInputs["directAccessIndexSpec"] = state?.directAccessIndexSpec;
resourceInputs["endpointName"] = state?.endpointName;
resourceInputs["indexType"] = state?.indexType;
resourceInputs["name"] = state?.name;
resourceInputs["primaryKey"] = state?.primaryKey;
resourceInputs["statuses"] = state?.statuses;
}
else {
const args = argsOrState;
if (args?.endpointName === undefined && !opts.urn) {
throw new Error("Missing required property 'endpointName'");
}
if (args?.indexType === undefined && !opts.urn) {
throw new Error("Missing required property 'indexType'");
}
if (args?.primaryKey === undefined && !opts.urn) {
throw new Error("Missing required property 'primaryKey'");
}
resourceInputs["deltaSyncIndexSpec"] = args?.deltaSyncIndexSpec;
resourceInputs["directAccessIndexSpec"] = args?.directAccessIndexSpec;
resourceInputs["endpointName"] = args?.endpointName;
resourceInputs["indexType"] = args?.indexType;
resourceInputs["name"] = args?.name;
resourceInputs["primaryKey"] = args?.primaryKey;
resourceInputs["creator"] = undefined /*out*/;
resourceInputs["statuses"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(VectorSearchIndex.__pulumiType, name, resourceInputs, opts);
}
}
exports.VectorSearchIndex = VectorSearchIndex;
/** @internal */
VectorSearchIndex.__pulumiType = 'databricks:index/vectorSearchIndex:VectorSearchIndex';
//# sourceMappingURL=vectorSearchIndex.js.map