From 0d1a4bf433f6ec4a356c317f4fe973931845611a Mon Sep 17 00:00:00 2001 From: Julia Matuszewska Date: Fri, 15 Nov 2024 20:44:33 +0000 Subject: [PATCH] Change timeouts for CodeRepositoryIndex and bootstrap KMS key --- .../cloudaicompanion/CodeRepositoryIndex.yaml | 4 ++++ ..._gemini_code_repository_index_test.go.tmpl | 19 +++++++++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/mmv1/products/cloudaicompanion/CodeRepositoryIndex.yaml b/mmv1/products/cloudaicompanion/CodeRepositoryIndex.yaml index a226364946e1..e10f42bfdf3b 100644 --- a/mmv1/products/cloudaicompanion/CodeRepositoryIndex.yaml +++ b/mmv1/products/cloudaicompanion/CodeRepositoryIndex.yaml @@ -29,6 +29,10 @@ examples: cri_id: '"cri-example"' exclude_test: true autogen_async: true +timeouts: + insert_minutes: 90 + update_minutes: 90 + delete_minutes: 90 async: operation: timeouts: diff --git a/mmv1/third_party/terraform/services/gemini/resource_gemini_code_repository_index_test.go.tmpl b/mmv1/third_party/terraform/services/gemini/resource_gemini_code_repository_index_test.go.tmpl index 9135a4cf7cce..7680e31a892f 100644 --- a/mmv1/third_party/terraform/services/gemini/resource_gemini_code_repository_index_test.go.tmpl +++ b/mmv1/third_party/terraform/services/gemini/resource_gemini_code_repository_index_test.go.tmpl @@ -11,8 +11,10 @@ import ( ) func TestAccGeminiCodeRepositoryIndex_update(t *testing.T) { + bootstrappedKMS := acctest.BootstrapKMSKeyInLocation(t, "us-central1") context := map[string]interface{}{ "project_id": os.Getenv("GOOGLE_PROJECT"), + "kms_key": bootstrappedKMS.CryptoKey.Name, } acctest.VcrTest(t, resource.TestCase{ @@ -48,7 +50,20 @@ resource "google_gemini_code_repository_index" "example" { labels = {"ccfe_debug_note": "terraform_e2e_should_be_deleted"} location = "us-central1" code_repository_index_id = "test-cri-index-example" - kms_key = "projects/cloud-code-rag-github-access/locations/us-central1/keyRings/keyring-example-basic1/cryptoKeys/crypto-key-example" + kms_key = "%{kms_key}" +} + +data "google_project" "project" { + provider = google-beta +} + +resource "google_kms_crypto_key_iam_binding" "crypto_key_binding" { + provider = google-beta + crypto_key_id = "%{kms_key}" + role = "roles/cloudkms.cryptoOperator" + members = [ + "serviceAccount:service-${data.google_project.project.number}@gcp-sa-cloudaicompanion.iam.gserviceaccount.com", + ] } `, context) } @@ -60,7 +75,7 @@ resource "google_gemini_code_repository_index" "example" { labels = {"ccfe_debug_note": "terraform_e2e_should_be_deleted", "new_label": "new_val"} location = "us-central1" code_repository_index_id = "test-cri-index-example-update" - kms_key = "projects/cloud-code-rag-github-access/locations/us-central1/keyRings/keyring-example-basic1/cryptoKeys/crypto-key-example" + kms_key = "%{kms_key}" } `, context) }