resource "google_project_service" "vertex_ai" { project = var.project_id service = "aiplatform.googleapis.com" disable_on_destroy = false } resource "google_service_account" "agentgateway_vertex_ai" { project = var.project_id account_id = "********" display_name = "Agentgateway Vertex AI" } resource "google_project_iam_member" "agentgateway_vertex_ai" { project = var.project_id role = "roles/aiplatform.user" member = "serviceAccount:${google_service_account.agentgateway_vertex_ai.email}" depends_on = [google_project_service.vertex_ai] } resource "google_service_account_key" "agentgateway_vertex_ai" { service_account_id = google_service_account.agentgateway_vertex_ai.name } resource "vault_kv_secret_v2" "agentgateway_vertex_ai" { mount = "secret" name = "agentgateway/vertex-ai" data_json = jsonencode({ credentials-json = base64decode(google_service_account_key.agentgateway_vertex_ai.private_key) }) }