UNPKG

@pulumi/gcp

Version:

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

509 lines • 19.2 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.AiFeatureOnlineStoreFeatureview = void 0; const pulumi = __importStar(require("@pulumi/pulumi")); const utilities = __importStar(require("../utilities")); /** * FeatureView is representation of values that the FeatureOnlineStore will serve based on its syncConfig. * * To get more information about FeatureOnlineStoreFeatureview, see: * * * [API documentation](https://cloud.google.com/vertex-ai/docs/reference/rest/v1/projects.locations.featureOnlineStores.featureViews) * * How-to Guides * * [Official Documentation](https://cloud.google.com/vertex-ai/docs) * * ## Example Usage * * ### Vertex Ai Featureonlinestore Featureview * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const featureonlinestore = new gcp.vertex.AiFeatureOnlineStore("featureonlinestore", { * name: "example_feature_view", * labels: { * foo: "bar", * }, * region: "us-central1", * bigtable: { * autoScaling: { * minNodeCount: 1, * maxNodeCount: 2, * cpuUtilizationTarget: 80, * }, * }, * }); * const tf_test_dataset = new gcp.bigquery.Dataset("tf-test-dataset", { * datasetId: "example_feature_view", * friendlyName: "test", * description: "This is a test description", * location: "US", * }); * const tf_test_table = new gcp.bigquery.Table("tf-test-table", { * deletionProtection: false, * datasetId: tf_test_dataset.datasetId, * tableId: "example_feature_view", * schema: ` [ * { * \\"name\\": \\"entity_id\\", * \\"mode\\": \\"NULLABLE\\", * \\"type\\": \\"STRING\\", * \\"description\\": \\"Test default entity_id\\" * }, * { * \\"name\\": \\"test_entity_column\\", * \\"mode\\": \\"NULLABLE\\", * \\"type\\": \\"STRING\\", * \\"description\\": \\"test secondary entity column\\" * }, * { * \\"name\\": \\"feature_timestamp\\", * \\"mode\\": \\"NULLABLE\\", * \\"type\\": \\"TIMESTAMP\\", * \\"description\\": \\"Default timestamp value\\" * } * ] * `, * }); * const featureview = new gcp.vertex.AiFeatureOnlineStoreFeatureview("featureview", { * name: "example_feature_view", * region: "us-central1", * featureOnlineStore: featureonlinestore.name, * syncConfig: { * cron: "0 0 * * *", * }, * bigQuerySource: { * uri: pulumi.interpolate`bq://${tf_test_table.project}.${tf_test_table.datasetId}.${tf_test_table.tableId}`, * entityIdColumns: ["test_entity_column"], * }, * }); * const project = gcp.organizations.getProject({}); * ``` * ### Vertex Ai Featureonlinestore Featureview Feature Registry * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const featureonlinestore = new gcp.vertex.AiFeatureOnlineStore("featureonlinestore", { * name: "example_feature_view_feature_registry", * labels: { * foo: "bar", * }, * region: "us-central1", * bigtable: { * autoScaling: { * minNodeCount: 1, * maxNodeCount: 2, * cpuUtilizationTarget: 80, * }, * }, * }); * const sampleDataset = new gcp.bigquery.Dataset("sample_dataset", { * datasetId: "example_feature_view_feature_registry", * friendlyName: "test", * description: "This is a test description", * location: "US", * }); * const sampleTable = new gcp.bigquery.Table("sample_table", { * deletionProtection: false, * datasetId: sampleDataset.datasetId, * tableId: "example_feature_view_feature_registry", * schema: `[ * { * \\"name\\": \\"feature_id\\", * \\"type\\": \\"STRING\\", * \\"mode\\": \\"NULLABLE\\" * }, * { * \\"name\\": \\"example_feature_view_feature_registry\\", * \\"type\\": \\"STRING\\", * \\"mode\\": \\"NULLABLE\\" * }, * { * \\"name\\": \\"feature_timestamp\\", * \\"type\\": \\"TIMESTAMP\\", * \\"mode\\": \\"NULLABLE\\" * } * ] * `, * }); * const sampleFeatureGroup = new gcp.vertex.AiFeatureGroup("sample_feature_group", { * name: "example_feature_view_feature_registry", * description: "A sample feature group", * region: "us-central1", * labels: { * "label-one": "value-one", * }, * bigQuery: { * bigQuerySource: { * inputUri: pulumi.interpolate`bq://${sampleTable.project}.${sampleTable.datasetId}.${sampleTable.tableId}`, * }, * entityIdColumns: ["feature_id"], * }, * }); * const sampleFeature = new gcp.vertex.AiFeatureGroupFeature("sample_feature", { * name: "example_feature_view_feature_registry", * region: "us-central1", * featureGroup: sampleFeatureGroup.name, * description: "A sample feature", * labels: { * "label-one": "value-one", * }, * }); * const featureviewFeatureregistry = new gcp.vertex.AiFeatureOnlineStoreFeatureview("featureview_featureregistry", { * name: "example_feature_view_feature_registry", * region: "us-central1", * featureOnlineStore: featureonlinestore.name, * syncConfig: { * cron: "0 0 * * *", * }, * featureRegistrySource: { * featureGroups: [{ * featureGroupId: sampleFeatureGroup.name, * featureIds: [sampleFeature.name], * }], * }, * }); * ``` * ### Vertex Ai Featureonlinestore Featureview Cross Project * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * import * as time from "@pulumiverse/time"; * * const testProject = gcp.organizations.getProject({}); * const project = new gcp.organizations.Project("project", { * projectId: "tf-test_9305", * name: "tf-test_48542", * orgId: "123456789", * billingAccount: "000000-0000000-0000000-000000", * deletionPolicy: "DELETE", * }); * const wait60Seconds = new time.Sleep("wait_60_seconds", {createDuration: "60s"}, { * dependsOn: [project], * }); * const vertexai = new gcp.projects.Service("vertexai", { * service: "aiplatform.googleapis.com", * project: project.projectId, * }, { * dependsOn: [wait60Seconds], * }); * const featureonlinestore = new gcp.vertex.AiFeatureOnlineStore("featureonlinestore", { * name: "example_cross_project_featureview", * project: project.projectId, * labels: { * foo: "bar", * }, * region: "us-central1", * bigtable: { * autoScaling: { * minNodeCount: 1, * maxNodeCount: 2, * cpuUtilizationTarget: 80, * }, * }, * }, { * dependsOn: [vertexai], * }); * const sampleDataset = new gcp.bigquery.Dataset("sample_dataset", { * datasetId: "example_cross_project_featureview", * friendlyName: "test", * description: "This is a test description", * location: "US", * }); * const viewer = new gcp.bigquery.DatasetIamMember("viewer", { * project: testProject.then(testProject => testProject.projectId), * datasetId: sampleDataset.datasetId, * role: "roles/bigquery.dataViewer", * member: pulumi.interpolate`serviceAccount:service-${project.number}@gcp-sa-aiplatform.iam.gserviceaccount.com`, * }, { * dependsOn: [featureonlinestore], * }); * const wait30Seconds = new time.Sleep("wait_30_seconds", {createDuration: "30s"}, { * dependsOn: [viewer], * }); * const sampleTable = new gcp.bigquery.Table("sample_table", { * deletionProtection: false, * datasetId: sampleDataset.datasetId, * tableId: "example_cross_project_featureview", * schema: `[ * { * \\"name\\": \\"feature_id\\", * \\"type\\": \\"STRING\\", * \\"mode\\": \\"NULLABLE\\" * }, * { * \\"name\\": \\"example_cross_project_featureview\\", * \\"type\\": \\"STRING\\", * \\"mode\\": \\"NULLABLE\\" * }, * { * \\"name\\": \\"feature_timestamp\\", * \\"type\\": \\"TIMESTAMP\\", * \\"mode\\": \\"NULLABLE\\" * } * ] * `, * }); * const sampleFeatureGroup = new gcp.vertex.AiFeatureGroup("sample_feature_group", { * name: "example_cross_project_featureview", * description: "A sample feature group", * region: "us-central1", * labels: { * "label-one": "value-one", * }, * bigQuery: { * bigQuerySource: { * inputUri: pulumi.interpolate`bq://${sampleTable.project}.${sampleTable.datasetId}.${sampleTable.tableId}`, * }, * entityIdColumns: ["feature_id"], * }, * }); * const sampleFeature = new gcp.vertex.AiFeatureGroupFeature("sample_feature", { * name: "example_cross_project_featureview", * region: "us-central1", * featureGroup: sampleFeatureGroup.name, * description: "A sample feature", * labels: { * "label-one": "value-one", * }, * }); * const crossProjectFeatureview = new gcp.vertex.AiFeatureOnlineStoreFeatureview("cross_project_featureview", { * name: "example_cross_project_featureview", * project: project.projectId, * region: "us-central1", * featureOnlineStore: featureonlinestore.name, * syncConfig: { * continuous: true, * }, * featureRegistrySource: { * featureGroups: [{ * featureGroupId: sampleFeatureGroup.name, * featureIds: [sampleFeature.name], * }], * projectNumber: testProject.then(testProject => testProject.number), * }, * }, { * dependsOn: [ * vertexai, * wait30Seconds, * ], * }); * ``` * ### Vertex Ai Featureonlinestore Featureview With Vector Search * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const featureonlinestore = new gcp.vertex.AiFeatureOnlineStore("featureonlinestore", { * name: "example_feature_view_vector_search", * labels: { * foo: "bar", * }, * region: "us-central1", * optimized: {}, * embeddingManagement: { * enabled: true, * }, * }); * const tf_test_dataset = new gcp.bigquery.Dataset("tf-test-dataset", { * datasetId: "example_feature_view_vector_search", * friendlyName: "test", * description: "This is a test description", * location: "US", * }); * const tf_test_table = new gcp.bigquery.Table("tf-test-table", { * deletionProtection: false, * datasetId: tf_test_dataset.datasetId, * tableId: "example_feature_view_vector_search", * schema: `[ * { * \\"name\\": \\"test_primary_id\\", * \\"mode\\": \\"NULLABLE\\", * \\"type\\": \\"STRING\\", * \\"description\\": \\"primary test id\\" * }, * { * \\"name\\": \\"embedding\\", * \\"mode\\": \\"REPEATED\\", * \\"type\\": \\"FLOAT\\", * \\"description\\": \\"embedding column for primary_id column\\" * }, * { * \\"name\\": \\"country\\", * \\"mode\\": \\"NULLABLE\\", * \\"type\\": \\"STRING\\", * \\"description\\": \\"country\\" * }, * { * \\"name\\": \\"test_crowding_column\\", * \\"mode\\": \\"NULLABLE\\", * \\"type\\": \\"INTEGER\\", * \\"description\\": \\"test crowding column\\" * }, * { * \\"name\\": \\"entity_id\\", * \\"mode\\": \\"NULLABLE\\", * \\"type\\": \\"STRING\\", * \\"description\\": \\"Test default entity_id\\" * }, * { * \\"name\\": \\"test_entity_column\\", * \\"mode\\": \\"NULLABLE\\", * \\"type\\": \\"STRING\\", * \\"description\\": \\"test secondary entity column\\" * }, * { * \\"name\\": \\"feature_timestamp\\", * \\"mode\\": \\"NULLABLE\\", * \\"type\\": \\"TIMESTAMP\\", * \\"description\\": \\"Default timestamp value\\" * } * ] * `, * }); * const featureviewVectorSearch = new gcp.vertex.AiFeatureOnlineStoreFeatureview("featureview_vector_search", { * name: "example_feature_view_vector_search", * region: "us-central1", * featureOnlineStore: featureonlinestore.name, * syncConfig: { * cron: "0 0 * * *", * }, * bigQuerySource: { * uri: pulumi.interpolate`bq://${tf_test_table.project}.${tf_test_table.datasetId}.${tf_test_table.tableId}`, * entityIdColumns: ["test_entity_column"], * }, * vectorSearchConfig: { * embeddingColumn: "embedding", * filterColumns: ["country"], * crowdingColumn: "test_crowding_column", * distanceMeasureType: "DOT_PRODUCT_DISTANCE", * treeAhConfig: { * leafNodeEmbeddingCount: "1000", * }, * embeddingDimension: 2, * }, * }); * const project = gcp.organizations.getProject({}); * ``` * * ## Import * * FeatureOnlineStoreFeatureview can be imported using any of these accepted formats: * * * `projects/{{project}}/locations/{{region}}/featureOnlineStores/{{feature_online_store}}/featureViews/{{name}}` * * `{{project}}/{{region}}/{{feature_online_store}}/{{name}}` * * `{{region}}/{{feature_online_store}}/{{name}}` * * `{{feature_online_store}}/{{name}}` * * When using the `pulumi import` command, FeatureOnlineStoreFeatureview can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:vertex/aiFeatureOnlineStoreFeatureview:AiFeatureOnlineStoreFeatureview default projects/{{project}}/locations/{{region}}/featureOnlineStores/{{feature_online_store}}/featureViews/{{name}} * $ pulumi import gcp:vertex/aiFeatureOnlineStoreFeatureview:AiFeatureOnlineStoreFeatureview default {{project}}/{{region}}/{{feature_online_store}}/{{name}} * $ pulumi import gcp:vertex/aiFeatureOnlineStoreFeatureview:AiFeatureOnlineStoreFeatureview default {{region}}/{{feature_online_store}}/{{name}} * $ pulumi import gcp:vertex/aiFeatureOnlineStoreFeatureview:AiFeatureOnlineStoreFeatureview default {{feature_online_store}}/{{name}} * ``` */ class AiFeatureOnlineStoreFeatureview extends pulumi.CustomResource { /** * Get an existing AiFeatureOnlineStoreFeatureview 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 AiFeatureOnlineStoreFeatureview(name, state, { ...opts, id: id }); } /** @internal */ static __pulumiType = 'gcp:vertex/aiFeatureOnlineStoreFeatureview:AiFeatureOnlineStoreFeatureview'; /** * Returns true if the given object is an instance of AiFeatureOnlineStoreFeatureview. 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'] === AiFeatureOnlineStoreFeatureview.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["bigQuerySource"] = state?.bigQuerySource; resourceInputs["createTime"] = state?.createTime; resourceInputs["deletionPolicy"] = state?.deletionPolicy; resourceInputs["effectiveLabels"] = state?.effectiveLabels; resourceInputs["featureOnlineStore"] = state?.featureOnlineStore; resourceInputs["featureRegistrySource"] = state?.featureRegistrySource; resourceInputs["labels"] = state?.labels; resourceInputs["name"] = state?.name; resourceInputs["project"] = state?.project; resourceInputs["pulumiLabels"] = state?.pulumiLabels; resourceInputs["region"] = state?.region; resourceInputs["syncConfig"] = state?.syncConfig; resourceInputs["updateTime"] = state?.updateTime; resourceInputs["vectorSearchConfig"] = state?.vectorSearchConfig; } else { const args = argsOrState; if (args?.featureOnlineStore === undefined && !opts.urn) { throw new Error("Missing required property 'featureOnlineStore'"); } resourceInputs["bigQuerySource"] = args?.bigQuerySource; resourceInputs["deletionPolicy"] = args?.deletionPolicy; resourceInputs["featureOnlineStore"] = args?.featureOnlineStore; resourceInputs["featureRegistrySource"] = args?.featureRegistrySource; resourceInputs["labels"] = args?.labels; resourceInputs["name"] = args?.name; resourceInputs["project"] = args?.project; resourceInputs["region"] = args?.region; resourceInputs["syncConfig"] = args?.syncConfig; resourceInputs["vectorSearchConfig"] = args?.vectorSearchConfig; resourceInputs["createTime"] = undefined /*out*/; resourceInputs["effectiveLabels"] = 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(AiFeatureOnlineStoreFeatureview.__pulumiType, name, resourceInputs, opts); } } exports.AiFeatureOnlineStoreFeatureview = AiFeatureOnlineStoreFeatureview; //# sourceMappingURL=aiFeatureOnlineStoreFeatureview.js.map