Open natedogith1 opened 2 months ago
Hi @natedogith1 please provide the vars you are managing to replicate this issue (for sensitive data you can just put a comment like #provided
)
I haven't tested, but I expect you'd get a similar error with:
resource "google_vertex_ai_index" "index" {
display_name = "test-index"
}
This example was replicated successfully without errors in terraform plan and terraform apply. I suggest you follow the next examples because everything indicates that the variables that you have declared in your metadata configuration are causing this error.
Here's the error I get from terraform apply
after adding each level of optional argument.
local.project_id
is a project id, local.region
is "europe-west3"
, local.contents_delta_gcs_uri
is a gcs://
uri that points to an empty bucket.
resource "google_vertex_ai_index" "index" {
project = local.project_id
display_name = "test-display-name"
index_update_method = "BATCH_UPDATE"
region = local.region
}
Error: Error creating Index: googleapi: Error 400: Index metadata is missing.
resource "google_vertex_ai_index" "index" {
project = local.project_id
display_name = "test-display-name"
index_update_method = "BATCH_UPDATE"
region = local.region
metadata {
contents_delta_uri = local.contents_delta_gcs_uri
is_complete_overwrite = false
}
}
Error: Error creating Index: googleapi: Error 400: dimensions is required but missing from Index metadata.
resource "google_vertex_ai_index" "index" {
project = local.project_id
display_name = "test-display-name"
index_update_method = "BATCH_UPDATE"
region = local.region
metadata {
contents_delta_uri = local.contents_delta_gcs_uri
is_complete_overwrite = false
config {
dimensions = 3
}
}
}
Error: Error creating Index: googleapi: Error 400: algorithmConfig is required but missing from the metadata.
resource "google_vertex_ai_index" "index" {
project = local.project_id
display_name = "test-display-name"
index_update_method = "BATCH_UPDATE"
region = local.region
metadata {
contents_delta_uri = local.contents_delta_gcs_uri
is_complete_overwrite = false
config {
dimensions = 3
algorithm_config {
}
}
}
}
Error: Error creating Index: googleapi: Error 400: algorithmConfig is required but missing from the metadata.
resource "google_vertex_ai_index" "index" {
project = local.project_id
display_name = "test-display-name"
index_update_method = "BATCH_UPDATE"
region = local.region
metadata {
contents_delta_uri = local.contents_delta_gcs_uri
is_complete_overwrite = false
config {
dimensions = 3
algorithm_config {
brute_force_config {}
}
}
}
}
Error: Error waiting to create Index: Error waiting for Creating Index: Error code 9, message: FAILED_PRECONDITION
Following the next configuration that is available on the shared link with your specifications everything was successfully replicated again without errors with the next configuration:
resource "google_storage_bucket" "bucket_17804" {
name = "vertex-ai-index-test-17804"
location = "europe-west3"
uniform_bucket_level_access = true
}
resource "google_vertex_ai_index" "google_vertex_ai_index_17804" {
display_name = "google-vertex-ai-index-17804"
index_update_method = "BATCH_UPDATE"
region = "europe-west3"
metadata {
contents_delta_uri = "gs://${google_storage_bucket.bucket_17804.name}/contents"
is_complete_overwrite = false
config {
dimensions = 3
algorithm_config {
brute_force_config {}
}
}
}
}
I suggest you check your user and account permissions and follow the documentation IO.
After a new replication with just this code the issue was confirmed:
resource "google_vertex_ai_index" "google_vertex_ai_index_17804" {
display_name = "google-vertex-ai-index-17804"
index_update_method = "BATCH_UPDATE"
region = "europe-west3"
}
It is returning the next message even when the metadata
appears as an optional argument in terraform registry:
Error: Error creating Index: googleapi: Error 400: Index metadata is missing.
metadata.contents_delta_uri is Required according to terraform registry
Community Note
Terraform Version
Terraform v1.3.9 on linux_amd64
Affected Resource(s)
google_vertex_ai_index
Terraform Configuration
Debug Output
No response
Expected Behavior
terraform plan
should have failed, becauseterraform apply
will failActual Behavior
terraform plan
passes, butterraform apply
fails with the error:Error: Error creating Index: googleapi: Error 400: algorithmConfig is required but missing from the metadata.
Steps to reproduce
terraform plan
terraform apply
Important Factoids
No response
References
No response
b/341993952