UNPKG

@pulumi/gcp

Version:

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

506 lines • 18.5 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.AiFeatureOnlineStoreFeatureview = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = 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 "@pulumi/time"; * * const testProject = gcp.organizations.getProject({}); * const project = new gcp.organizations.Project("project", { * projectId: "tf-test_35305", * name: "tf-test_62793", * orgId: "123456789", * billingAccount: "000000-0000000-0000000-000000", * deletionPolicy: "DELETE", * }); * const wait60Seconds = new time.index.Sleep("wait_60_seconds", {createDuration: "60s"}, { * dependsOn: [project], * }); * const vertexai = new gcp.projects.Service("vertexai", { * service: "aiplatform.googleapis.com", * project: project.projectId, * disableOnDestroy: false, * }, { * 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.index.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: { * cron: "0 0 * * *", * }, * 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", * bigtable: { * autoScaling: { * minNodeCount: 1, * maxNodeCount: 2, * cpuUtilizationTarget: 80, * }, * }, * 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}} * ``` * * ```sh * $ pulumi import gcp:vertex/aiFeatureOnlineStoreFeatureview:AiFeatureOnlineStoreFeatureview default {{project}}/{{region}}/{{feature_online_store}}/{{name}} * ``` * * ```sh * $ pulumi import gcp:vertex/aiFeatureOnlineStoreFeatureview:AiFeatureOnlineStoreFeatureview default {{region}}/{{feature_online_store}}/{{name}} * ``` * * ```sh * $ 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, Object.assign(Object.assign({}, opts), { id: id })); } /** * 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 ? state.bigQuerySource : undefined; resourceInputs["createTime"] = state ? state.createTime : undefined; resourceInputs["effectiveLabels"] = state ? state.effectiveLabels : undefined; resourceInputs["featureOnlineStore"] = state ? state.featureOnlineStore : undefined; resourceInputs["featureRegistrySource"] = state ? state.featureRegistrySource : undefined; resourceInputs["labels"] = state ? state.labels : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["project"] = state ? state.project : undefined; resourceInputs["pulumiLabels"] = state ? state.pulumiLabels : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["syncConfig"] = state ? state.syncConfig : undefined; resourceInputs["updateTime"] = state ? state.updateTime : undefined; resourceInputs["vectorSearchConfig"] = state ? state.vectorSearchConfig : undefined; } else { const args = argsOrState; if ((!args || args.featureOnlineStore === undefined) && !opts.urn) { throw new Error("Missing required property 'featureOnlineStore'"); } if ((!args || args.region === undefined) && !opts.urn) { throw new Error("Missing required property 'region'"); } resourceInputs["bigQuerySource"] = args ? args.bigQuerySource : undefined; resourceInputs["featureOnlineStore"] = args ? args.featureOnlineStore : undefined; resourceInputs["featureRegistrySource"] = args ? args.featureRegistrySource : undefined; resourceInputs["labels"] = args ? args.labels : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["project"] = args ? args.project : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["syncConfig"] = args ? args.syncConfig : undefined; resourceInputs["vectorSearchConfig"] = args ? args.vectorSearchConfig : undefined; 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; /** @internal */ AiFeatureOnlineStoreFeatureview.__pulumiType = 'gcp:vertex/aiFeatureOnlineStoreFeatureview:AiFeatureOnlineStoreFeatureview'; //# sourceMappingURL=aiFeatureOnlineStoreFeatureview.js.map