@pulumi/databricks
Version:
A Pulumi package for creating and managing databricks cloud resources.
109 lines • 5.19 kB
JavaScript
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** 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 can only be used on a Unity Catalog-enabled workspace!
*
* 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.
*
* ## 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
*
* 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, Object.assign(Object.assign({}, 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 ? state.creator : undefined;
resourceInputs["deltaSyncIndexSpec"] = state ? state.deltaSyncIndexSpec : undefined;
resourceInputs["directAccessIndexSpec"] = state ? state.directAccessIndexSpec : undefined;
resourceInputs["endpointName"] = state ? state.endpointName : undefined;
resourceInputs["indexType"] = state ? state.indexType : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["primaryKey"] = state ? state.primaryKey : undefined;
resourceInputs["statuses"] = state ? state.statuses : undefined;
}
else {
const args = argsOrState;
if ((!args || args.endpointName === undefined) && !opts.urn) {
throw new Error("Missing required property 'endpointName'");
}
if ((!args || args.indexType === undefined) && !opts.urn) {
throw new Error("Missing required property 'indexType'");
}
if ((!args || args.primaryKey === undefined) && !opts.urn) {
throw new Error("Missing required property 'primaryKey'");
}
resourceInputs["deltaSyncIndexSpec"] = args ? args.deltaSyncIndexSpec : undefined;
resourceInputs["directAccessIndexSpec"] = args ? args.directAccessIndexSpec : undefined;
resourceInputs["endpointName"] = args ? args.endpointName : undefined;
resourceInputs["indexType"] = args ? args.indexType : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["primaryKey"] = args ? args.primaryKey : undefined;
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
;