Skip to content

Commit

Permalink
Change timeouts for CodeRepositoryIndex and bootstrap KMS key
Browse files Browse the repository at this point in the history
  • Loading branch information
JumiDeluxe committed Nov 18, 2024
1 parent bbddff0 commit 0d1a4bf
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
4 changes: 4 additions & 0 deletions mmv1/products/cloudaicompanion/CodeRepositoryIndex.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down Expand Up @@ -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)
}
Expand All @@ -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)
}
Expand Down

0 comments on commit 0d1a4bf

Please sign in to comment.