UNPKG

@pulumi/gcp

Version:

A Pulumi package for creating and managing Google Cloud Platform resources.

149 lines 6.58 kB
"use strict"; // *** 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.SearchEngine = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Vertex AI Search and Conversation can be used to create a search engine or a chat application by connecting it with a datastore * * To get more information about SearchEngine, see: * * * [API documentation](https://cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1/projects.locations.collections.engines) * * How-to Guides * * [Create a Search Engine](https://cloud.google.com/generative-ai-app-builder/docs/create-engine-es) * * ## Example Usage * * ### Discoveryengine Searchengine Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const basic = new gcp.discoveryengine.DataStore("basic", { * location: "global", * dataStoreId: "example-datastore-id", * displayName: "tf-test-structured-datastore", * industryVertical: "GENERIC", * contentConfig: "NO_CONTENT", * solutionTypes: ["SOLUTION_TYPE_SEARCH"], * createAdvancedSiteSearch: false, * }); * const basicSearchEngine = new gcp.discoveryengine.SearchEngine("basic", { * engineId: "example-engine-id", * collectionId: "default_collection", * location: basic.location, * displayName: "Example Display Name", * dataStoreIds: [basic.dataStoreId], * searchEngineConfig: {}, * }); * ``` * * ## Import * * SearchEngine can be imported using any of these accepted formats: * * * `projects/{{project}}/locations/{{location}}/collections/{{collection_id}}/engines/{{engine_id}}` * * * `{{project}}/{{location}}/{{collection_id}}/{{engine_id}}` * * * `{{location}}/{{collection_id}}/{{engine_id}}` * * When using the `pulumi import` command, SearchEngine can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:discoveryengine/searchEngine:SearchEngine default projects/{{project}}/locations/{{location}}/collections/{{collection_id}}/engines/{{engine_id}} * ``` * * ```sh * $ pulumi import gcp:discoveryengine/searchEngine:SearchEngine default {{project}}/{{location}}/{{collection_id}}/{{engine_id}} * ``` * * ```sh * $ pulumi import gcp:discoveryengine/searchEngine:SearchEngine default {{location}}/{{collection_id}}/{{engine_id}} * ``` */ class SearchEngine extends pulumi.CustomResource { /** * Get an existing SearchEngine 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 SearchEngine(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of SearchEngine. 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'] === SearchEngine.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["collectionId"] = state?.collectionId; resourceInputs["commonConfig"] = state?.commonConfig; resourceInputs["createTime"] = state?.createTime; resourceInputs["dataStoreIds"] = state?.dataStoreIds; resourceInputs["displayName"] = state?.displayName; resourceInputs["engineId"] = state?.engineId; resourceInputs["industryVertical"] = state?.industryVertical; resourceInputs["location"] = state?.location; resourceInputs["name"] = state?.name; resourceInputs["project"] = state?.project; resourceInputs["searchEngineConfig"] = state?.searchEngineConfig; resourceInputs["updateTime"] = state?.updateTime; } else { const args = argsOrState; if (args?.collectionId === undefined && !opts.urn) { throw new Error("Missing required property 'collectionId'"); } if (args?.dataStoreIds === undefined && !opts.urn) { throw new Error("Missing required property 'dataStoreIds'"); } if (args?.displayName === undefined && !opts.urn) { throw new Error("Missing required property 'displayName'"); } if (args?.engineId === undefined && !opts.urn) { throw new Error("Missing required property 'engineId'"); } if (args?.location === undefined && !opts.urn) { throw new Error("Missing required property 'location'"); } if (args?.searchEngineConfig === undefined && !opts.urn) { throw new Error("Missing required property 'searchEngineConfig'"); } resourceInputs["collectionId"] = args?.collectionId; resourceInputs["commonConfig"] = args?.commonConfig; resourceInputs["dataStoreIds"] = args?.dataStoreIds; resourceInputs["displayName"] = args?.displayName; resourceInputs["engineId"] = args?.engineId; resourceInputs["industryVertical"] = args?.industryVertical; resourceInputs["location"] = args?.location; resourceInputs["project"] = args?.project; resourceInputs["searchEngineConfig"] = args?.searchEngineConfig; resourceInputs["createTime"] = undefined /*out*/; resourceInputs["name"] = undefined /*out*/; resourceInputs["updateTime"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(SearchEngine.__pulumiType, name, resourceInputs, opts); } } exports.SearchEngine = SearchEngine; /** @internal */ SearchEngine.__pulumiType = 'gcp:discoveryengine/searchEngine:SearchEngine'; //# sourceMappingURL=searchEngine.js.map