google_vertex_ai_feature_online_store_featureview

FeatureView is representation of values that the FeatureOnlineStore will serve based on its syncConfig.

To get more information about FeatureOnlineStoreFeatureview, see:

Open in Cloud Shell

Example Usage - Vertex Ai Featureonlinestore Featureview

resource "google_vertex_ai_feature_online_store" "featureonlinestore" {
  name = "example_feature_view"
  labels = {
    foo = "bar"
  }
  region = "us-central1"
  bigtable {
    auto_scaling {
      min_node_count         = 1
      max_node_count         = 2
      cpu_utilization_target = 80
    }
  }
}

resource "google_bigquery_dataset" "tf-test-dataset" {

  dataset_id    = "example_feature_view"
  friendly_name = "test"
  description   = "This is a test description"
  location      = "US"
}

resource "google_bigquery_table" "tf-test-table" {
  deletion_protection = false

  dataset_id = google_bigquery_dataset.tf-test-dataset.dataset_id
  table_id   = "example_feature_view"
  schema     = <<EOF
  [
  {
    "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"
  }
]
EOF
}

resource "google_vertex_ai_feature_online_store_featureview" "featureview" {
  name                 = "example_feature_view"
  region               = "us-central1"
  feature_online_store = google_vertex_ai_feature_online_store.featureonlinestore.name
  sync_config {
    cron = "0 0 * * *"
  }
  big_query_source {
    uri               = "bq://${google_bigquery_table.tf-test-table.project}.${google_bigquery_table.tf-test-table.dataset_id}.${google_bigquery_table.tf-test-table.table_id}"
    entity_id_columns = ["test_entity_column"]

  }
}

data "google_project" "project" {
  provider = google
}
Open in Cloud Shell

Example Usage - Vertex Ai Featureonlinestore Featureview Feature Registry

resource "google_vertex_ai_feature_online_store" "featureonlinestore" {
  name     = "example_feature_view_feature_registry"
  labels = {
    foo = "bar"
  }
  region = "us-central1"
  bigtable {
    auto_scaling {
      min_node_count         = 1
      max_node_count         = 2
      cpu_utilization_target = 80
    }
  }
}

resource "google_bigquery_dataset" "sample_dataset" {
  dataset_id                  = "example_feature_view_feature_registry"
  friendly_name               = "test"
  description                 = "This is a test description"
  location                    = "US"
}

resource "google_bigquery_table" "sample_table" {
  deletion_protection = false
  dataset_id = google_bigquery_dataset.sample_dataset.dataset_id
  table_id   = "example_feature_view_feature_registry"

  schema = <<EOF
[
    {
        "name": "feature_id",
        "type": "STRING",
        "mode": "NULLABLE"
    },
    {
        "name": "example_feature_view_feature_registry",
        "type": "STRING",
        "mode": "NULLABLE"
    },
    {
        "name": "feature_timestamp",
        "type": "TIMESTAMP",
        "mode": "NULLABLE"
    }
]
EOF
}

resource "google_vertex_ai_feature_group" "sample_feature_group" {
  name = "example_feature_view_feature_registry"
  description = "A sample feature group"
  region = "us-central1"
  labels = {
      label-one = "value-one"
  }
  big_query {
    big_query_source {
        # The source table must have a column named 'feature_timestamp' of type TIMESTAMP.
        input_uri = "bq://${google_bigquery_table.sample_table.project}.${google_bigquery_table.sample_table.dataset_id}.${google_bigquery_table.sample_table.table_id}"
    }
    entity_id_columns = ["feature_id"]
  }
}



resource "google_vertex_ai_feature_group_feature" "sample_feature" {
  name = "example_feature_view_feature_registry"
  region = "us-central1"
  feature_group = google_vertex_ai_feature_group.sample_feature_group.name
  description = "A sample feature"
  labels = {
      label-one = "value-one"
  }
}


resource "google_vertex_ai_feature_online_store_featureview" "featureview_featureregistry" {
  name                 = "example_feature_view_feature_registry"
  region               = "us-central1"
  feature_online_store = google_vertex_ai_feature_online_store.featureonlinestore.name
  sync_config {
    cron = "0 0 * * *"
  }
  feature_registry_source {

    feature_groups { 
        feature_group_id = google_vertex_ai_feature_group.sample_feature_group.name
        feature_ids      = [google_vertex_ai_feature_group_feature.sample_feature.name]
       }
  }
}
Open in Cloud Shell
resource "google_vertex_ai_feature_online_store" "featureonlinestore" {
  provider = google-beta
  name     = "example_feature_view_vector_search"
  labels = {
    foo = "bar"
  }
  region = "us-central1"
  bigtable {
    auto_scaling {
      min_node_count         = 1
      max_node_count         = 2
      cpu_utilization_target = 80
    }
  }
  embedding_management {
    enabled = true
  }
}

resource "google_bigquery_dataset" "tf-test-dataset" {
  provider      = google-beta
  dataset_id    = "example_feature_view_vector_search"
  friendly_name = "test"
  description   = "This is a test description"
  location      = "US"
}

resource "google_bigquery_table" "tf-test-table" {
  provider            = google-beta
  deletion_protection = false
  dataset_id          = google_bigquery_dataset.tf-test-dataset.dataset_id
  table_id            = "example_feature_view_vector_search"
  schema              = <<EOF
[
{
  "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"
}
]
EOF
}
resource "google_vertex_ai_feature_online_store_featureview" "featureview_vector_search" {
  provider             = google-beta
  name                 = "example_feature_view_vector_search"
  region               = "us-central1"
  feature_online_store = google_vertex_ai_feature_online_store.featureonlinestore.name
  sync_config {
    cron = "0 0 * * *"
  }
  big_query_source {
    uri               = "bq://${google_bigquery_table.tf-test-table.project}.${google_bigquery_table.tf-test-table.dataset_id}.${google_bigquery_table.tf-test-table.table_id}"
    entity_id_columns = ["test_entity_column"]

  }
  vector_search_config {
    embedding_column      = "embedding"
    filter_columns        = ["country"]
    crowding_column       = "test_crowding_column"
    distance_measure_type = "DOT_PRODUCT_DISTANCE"
    tree_ah_config {
      leaf_node_embedding_count = "1000"
    }
    embedding_dimension = "2"
  }
}

data "google_project" "project" {
  provider = google-beta
}

Argument Reference

The following arguments are supported:


The sync_config block supports:

The big_query_source block supports:

The feature_registry_source block supports:

The feature_groups block supports:

The vector_search_config block supports:

The tree_ah_config block supports:

Attributes Reference

In addition to the arguments listed above, the following computed attributes are exported:

Timeouts

This resource provides the following Timeouts configuration options:

Import

FeatureOnlineStoreFeatureview can be imported using any of these accepted formats:

In Terraform v1.5.0 and later, use an import block to import FeatureOnlineStoreFeatureview using one of the formats above. For example:

import {
  id = "projects/{{project}}/locations/{{region}}/featureOnlineStores/{{feature_online_store}}/featureViews/{{name}}"
  to = google_vertex_ai_feature_online_store_featureview.default
}

When using the terraform import command, FeatureOnlineStoreFeatureview can be imported using one of the formats above. For example:

$ terraform import google_vertex_ai_feature_online_store_featureview.default projects/{{project}}/locations/{{region}}/featureOnlineStores/{{feature_online_store}}/featureViews/{{name}}
$ terraform import google_vertex_ai_feature_online_store_featureview.default {{project}}/{{region}}/{{feature_online_store}}/{{name}}
$ terraform import google_vertex_ai_feature_online_store_featureview.default {{region}}/{{feature_online_store}}/{{name}}
$ terraform import google_vertex_ai_feature_online_store_featureview.default {{feature_online_store}}/{{name}}

User Project Overrides

This resource supports User Project Overrides.