UNPKG

@pulumi/gcp

Version:

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

190 lines • 8.18 kB
"use strict"; // *** 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.AiIndexEndpoint = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * An endpoint indexes are deployed into. An index endpoint can have multiple deployed indexes. * * To get more information about IndexEndpoint, see: * * * [API documentation](https://cloud.google.com/vertex-ai/docs/reference/rest/v1/projects.locations.indexEndpoints/) * * ## Example Usage * * ### Vertex Ai Index Endpoint * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const vertexNetwork = new gcp.compute.Network("vertex_network", {name: "network-name"}); * const vertexRange = new gcp.compute.GlobalAddress("vertex_range", { * name: "address-name", * purpose: "VPC_PEERING", * addressType: "INTERNAL", * prefixLength: 24, * network: vertexNetwork.id, * }); * const vertexVpcConnection = new gcp.servicenetworking.Connection("vertex_vpc_connection", { * network: vertexNetwork.id, * service: "servicenetworking.googleapis.com", * reservedPeeringRanges: [vertexRange.name], * }); * const project = gcp.organizations.getProject({}); * const indexEndpoint = new gcp.vertex.AiIndexEndpoint("index_endpoint", { * displayName: "sample-endpoint", * description: "A sample vertex endpoint", * region: "us-central1", * labels: { * "label-one": "value-one", * }, * network: pulumi.all([project, vertexNetwork.name]).apply(([project, name]) => `projects/${project.number}/global/networks/${name}`), * }, { * dependsOn: [vertexVpcConnection], * }); * ``` * ### Vertex Ai Index Endpoint With Psc * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const project = gcp.organizations.getProject({}); * const indexEndpoint = new gcp.vertex.AiIndexEndpoint("index_endpoint", { * displayName: "sample-endpoint", * description: "A sample vertex endpoint", * region: "us-central1", * labels: { * "label-one": "value-one", * }, * privateServiceConnectConfig: { * enablePrivateServiceConnect: true, * projectAllowlists: [project.then(project => project.name)], * }, * }); * ``` * ### Vertex Ai Index Endpoint With Public Endpoint * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const indexEndpoint = new gcp.vertex.AiIndexEndpoint("index_endpoint", { * displayName: "sample-endpoint", * description: "A sample vertex endpoint with an public endpoint", * region: "us-central1", * labels: { * "label-one": "value-one", * }, * publicEndpointEnabled: true, * }); * ``` * * ## Import * * IndexEndpoint can be imported using any of these accepted formats: * * * `projects/{{project}}/locations/{{region}}/indexEndpoints/{{name}}` * * * `{{project}}/{{region}}/{{name}}` * * * `{{region}}/{{name}}` * * * `{{name}}` * * When using the `pulumi import` command, IndexEndpoint can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:vertex/aiIndexEndpoint:AiIndexEndpoint default projects/{{project}}/locations/{{region}}/indexEndpoints/{{name}} * ``` * * ```sh * $ pulumi import gcp:vertex/aiIndexEndpoint:AiIndexEndpoint default {{project}}/{{region}}/{{name}} * ``` * * ```sh * $ pulumi import gcp:vertex/aiIndexEndpoint:AiIndexEndpoint default {{region}}/{{name}} * ``` * * ```sh * $ pulumi import gcp:vertex/aiIndexEndpoint:AiIndexEndpoint default {{name}} * ``` */ class AiIndexEndpoint extends pulumi.CustomResource { /** * Get an existing AiIndexEndpoint 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 AiIndexEndpoint(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of AiIndexEndpoint. 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'] === AiIndexEndpoint.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["createTime"] = state ? state.createTime : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["displayName"] = state ? state.displayName : undefined; resourceInputs["effectiveLabels"] = state ? state.effectiveLabels : undefined; resourceInputs["etag"] = state ? state.etag : undefined; resourceInputs["labels"] = state ? state.labels : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["network"] = state ? state.network : undefined; resourceInputs["privateServiceConnectConfig"] = state ? state.privateServiceConnectConfig : undefined; resourceInputs["project"] = state ? state.project : undefined; resourceInputs["publicEndpointDomainName"] = state ? state.publicEndpointDomainName : undefined; resourceInputs["publicEndpointEnabled"] = state ? state.publicEndpointEnabled : undefined; resourceInputs["pulumiLabels"] = state ? state.pulumiLabels : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["updateTime"] = state ? state.updateTime : undefined; } else { const args = argsOrState; if ((!args || args.displayName === undefined) && !opts.urn) { throw new Error("Missing required property 'displayName'"); } resourceInputs["description"] = args ? args.description : undefined; resourceInputs["displayName"] = args ? args.displayName : undefined; resourceInputs["labels"] = args ? args.labels : undefined; resourceInputs["network"] = args ? args.network : undefined; resourceInputs["privateServiceConnectConfig"] = args ? args.privateServiceConnectConfig : undefined; resourceInputs["project"] = args ? args.project : undefined; resourceInputs["publicEndpointEnabled"] = args ? args.publicEndpointEnabled : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["createTime"] = undefined /*out*/; resourceInputs["effectiveLabels"] = undefined /*out*/; resourceInputs["etag"] = undefined /*out*/; resourceInputs["name"] = undefined /*out*/; resourceInputs["publicEndpointDomainName"] = undefined /*out*/; resourceInputs["pulumiLabels"] = undefined /*out*/; resourceInputs["updateTime"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const secretOpts = { additionalSecretOutputs: ["effectiveLabels", "pulumiLabels"] }; opts = pulumi.mergeOptions(opts, secretOpts); super(AiIndexEndpoint.__pulumiType, name, resourceInputs, opts); } } exports.AiIndexEndpoint = AiIndexEndpoint; /** @internal */ AiIndexEndpoint.__pulumiType = 'gcp:vertex/aiIndexEndpoint:AiIndexEndpoint'; //# sourceMappingURL=aiIndexEndpoint.js.map