UNPKG

@pulumi/gcp

Version:

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

255 lines • 11.3 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! *** var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.AiEndpoint = void 0; const pulumi = __importStar(require("@pulumi/pulumi")); const utilities = __importStar(require("../utilities")); /** * Models are deployed into it, and afterwards Endpoint is called to obtain predictions and explanations. * * To get more information about Endpoint, see: * * * [API documentation](https://cloud.google.com/vertex-ai/docs/reference/rest/v1/projects.locations.endpoints) * * How-to Guides * * [Official Documentation](https://cloud.google.com/vertex-ai/docs) * * ## Example Usage * * ### Vertex Ai Endpoint Network * * ```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 bqDataset = new gcp.bigquery.Dataset("bq_dataset", { * datasetId: "some_dataset", * friendlyName: "logging dataset", * description: "This is a dataset that requests are logged to", * location: "US", * deleteContentsOnDestroy: true, * }); * const project = gcp.organizations.getProject({}); * const endpoint = new gcp.vertex.AiEndpoint("endpoint", { * name: "endpoint-name", * displayName: "sample-endpoint", * description: "A sample vertex endpoint", * location: "us-central1", * region: "us-central1", * labels: { * "label-one": "value-one", * }, * network: pulumi.all([project, vertexNetwork.name]).apply(([project, name]) => `projects/${project.number}/global/networks/${name}`), * encryptionSpec: { * kmsKeyName: "kms-name", * }, * predictRequestResponseLoggingConfig: { * bigqueryDestination: { * outputUri: pulumi.all([project, bqDataset.datasetId]).apply(([project, datasetId]) => `bq://${project.projectId}.${datasetId}.request_response_logging`), * }, * enabled: true, * samplingRate: 0.1, * }, * trafficSplit: JSON.stringify({ * "12345": 100, * }), * }, { * dependsOn: [vertexVpcConnection], * }); * const cryptoKey = new gcp.kms.CryptoKeyIAMMember("crypto_key", { * cryptoKeyId: "kms-name", * role: "roles/cloudkms.cryptoKeyEncrypterDecrypter", * member: project.then(project => `serviceAccount:service-${project.number}@gcp-sa-aiplatform.iam.gserviceaccount.com`), * }); * ``` * ### Vertex Ai Endpoint Private Service Connect * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const _default = new gcp.compute.Network("default", {name: "psc-network-_9873"}); * const project = gcp.organizations.getProject({}); * const endpoint = new gcp.vertex.AiEndpoint("endpoint", { * name: "endpoint-name_48153", * displayName: "sample-endpoint", * description: "A sample vertex endpoint", * location: "us-central1", * region: "us-central1", * labels: { * "label-one": "value-one", * }, * privateServiceConnectConfig: { * enablePrivateServiceConnect: true, * projectAllowlists: [project.then(project => project.projectId)], * pscAutomationConfigs: [{ * projectId: project.then(project => project.projectId), * network: _default.id, * }], * }, * }); * ``` * ### Vertex Ai Endpoint Dedicated Endpoint * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const endpoint = new gcp.vertex.AiEndpoint("endpoint", { * name: "endpoint-name_58845", * displayName: "sample-endpoint", * description: "A sample vertex endpoint", * location: "us-central1", * region: "us-central1", * labels: { * "label-one": "value-one", * }, * dedicatedEndpointEnabled: true, * }); * const project = gcp.organizations.getProject({}); * ``` * * ## Import * * Endpoint can be imported using any of these accepted formats: * * * `projects/{{project}}/locations/{{location}}/endpoints/{{name}}` * * `{{project}}/{{location}}/{{name}}` * * `{{location}}/{{name}}` * * When using the `pulumi import` command, Endpoint can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:vertex/aiEndpoint:AiEndpoint default projects/{{project}}/locations/{{location}}/endpoints/{{name}} * $ pulumi import gcp:vertex/aiEndpoint:AiEndpoint default {{project}}/{{location}}/{{name}} * $ pulumi import gcp:vertex/aiEndpoint:AiEndpoint default {{location}}/{{name}} * ``` */ class AiEndpoint extends pulumi.CustomResource { /** * Get an existing AiEndpoint 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 AiEndpoint(name, state, { ...opts, id: id }); } /** @internal */ static __pulumiType = 'gcp:vertex/aiEndpoint:AiEndpoint'; /** * Returns true if the given object is an instance of AiEndpoint. 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'] === AiEndpoint.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["createTime"] = state?.createTime; resourceInputs["dedicatedEndpointDns"] = state?.dedicatedEndpointDns; resourceInputs["dedicatedEndpointEnabled"] = state?.dedicatedEndpointEnabled; resourceInputs["deletionPolicy"] = state?.deletionPolicy; resourceInputs["deployedModels"] = state?.deployedModels; resourceInputs["description"] = state?.description; resourceInputs["displayName"] = state?.displayName; resourceInputs["effectiveLabels"] = state?.effectiveLabels; resourceInputs["encryptionSpec"] = state?.encryptionSpec; resourceInputs["etag"] = state?.etag; resourceInputs["labels"] = state?.labels; resourceInputs["location"] = state?.location; resourceInputs["modelDeploymentMonitoringJob"] = state?.modelDeploymentMonitoringJob; resourceInputs["name"] = state?.name; resourceInputs["network"] = state?.network; resourceInputs["predictRequestResponseLoggingConfig"] = state?.predictRequestResponseLoggingConfig; resourceInputs["privateServiceConnectConfig"] = state?.privateServiceConnectConfig; resourceInputs["project"] = state?.project; resourceInputs["pulumiLabels"] = state?.pulumiLabels; resourceInputs["region"] = state?.region; resourceInputs["trafficSplit"] = state?.trafficSplit; resourceInputs["updateTime"] = state?.updateTime; } else { const args = argsOrState; if (args?.displayName === undefined && !opts.urn) { throw new Error("Missing required property 'displayName'"); } if (args?.location === undefined && !opts.urn) { throw new Error("Missing required property 'location'"); } resourceInputs["dedicatedEndpointEnabled"] = args?.dedicatedEndpointEnabled; resourceInputs["deletionPolicy"] = args?.deletionPolicy; resourceInputs["description"] = args?.description; resourceInputs["displayName"] = args?.displayName; resourceInputs["encryptionSpec"] = args?.encryptionSpec; resourceInputs["labels"] = args?.labels; resourceInputs["location"] = args?.location; resourceInputs["name"] = args?.name; resourceInputs["network"] = args?.network; resourceInputs["predictRequestResponseLoggingConfig"] = args?.predictRequestResponseLoggingConfig; resourceInputs["privateServiceConnectConfig"] = args?.privateServiceConnectConfig; resourceInputs["project"] = args?.project; resourceInputs["region"] = args?.region; resourceInputs["trafficSplit"] = args?.trafficSplit; resourceInputs["createTime"] = undefined /*out*/; resourceInputs["dedicatedEndpointDns"] = undefined /*out*/; resourceInputs["deployedModels"] = undefined /*out*/; resourceInputs["effectiveLabels"] = undefined /*out*/; resourceInputs["etag"] = undefined /*out*/; resourceInputs["modelDeploymentMonitoringJob"] = 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(AiEndpoint.__pulumiType, name, resourceInputs, opts); } } exports.AiEndpoint = AiEndpoint; //# sourceMappingURL=aiEndpoint.js.map