From a4d694c3a980387ba05d754d7d05455edab8a8a2 Mon Sep 17 00:00:00 2001 From: Rohit Jangid Date: Thu, 28 Mar 2024 19:09:08 +0530 Subject: [PATCH] Fix client request only properties. (#10299) --- mmv1/products/integrations/Client.yaml | 8 ++++---- .../integrations_client_advance.tf.erb | 18 +++++++++++------- .../examples/integrations_client_basic.tf.erb | 1 + 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/mmv1/products/integrations/Client.yaml b/mmv1/products/integrations/Client.yaml index e9bb0e0d427d..af65456395bc 100644 --- a/mmv1/products/integrations/Client.yaml +++ b/mmv1/products/integrations/Client.yaml @@ -48,7 +48,7 @@ properties: description: | Cloud KMS config for AuthModule to encrypt/decrypt credentials. immutable: true - url_param_only: true + ignore_read: true properties: - !ruby/object:Api::Type::String name: "kmsLocation" @@ -88,19 +88,19 @@ properties: description: | Indicates if sample workflow should be created along with provisioning. immutable: true - url_param_only: true + ignore_read: true - !ruby/object:Api::Type::Boolean name: 'provisionGmek' description: | Indicates provision with GMEK or CMEK. immutable: true - url_param_only: true + ignore_read: true - !ruby/object:Api::Type::String name: 'runAsServiceAccount' description: | User input run-as service account, if empty, will bring up a new default service account. immutable: true - url_param_only: true + ignore_read: true examples: - !ruby/object:Provider::Terraform::Examples name: "integrations_client_basic" diff --git a/mmv1/templates/terraform/examples/integrations_client_advance.tf.erb b/mmv1/templates/terraform/examples/integrations_client_advance.tf.erb index 54e2de273ca9..f874971cd2fa 100644 --- a/mmv1/templates/terraform/examples/integrations_client_advance.tf.erb +++ b/mmv1/templates/terraform/examples/integrations_client_advance.tf.erb @@ -3,7 +3,7 @@ data "google_project" "test_project" { resource "google_kms_key_ring" "keyring" { name = "<%= ctx[:vars]['key_ring_name'] %>" - location = "us-central1" + location = "us-east1" } resource "google_kms_crypto_key" "cryptokey" { @@ -18,17 +18,21 @@ resource "google_kms_crypto_key_version" "test_key" { depends_on = [google_kms_crypto_key.cryptokey] } +resource "google_service_account" "service_account" { + account_id = "service-account-id" + display_name = "Service Account" +} + resource "google_integrations_client" "<%= ctx[:primary_resource_id] %>" { - location = "us-central1" + location = "us-east1" create_sample_workflows = true - provision_gmek = true - run_as_service_account = "radndom-service-account" + run_as_service_account = google_service_account.service_account.email cloud_kms_config { - kms_location = "us-central1" + kms_location = "us-east1" kms_ring = google_kms_key_ring.keyring.id key = google_kms_crypto_key.cryptokey.id key_version = google_kms_crypto_key_version.test_key.id - kms_project_id = data.google_project.test_project.id + kms_project_id = data.google_project.test_project.project_id } - depends_on = [google_kms_crypto_key_version.test_key] + depends_on = [google_kms_crypto_key_version.test_key, google_service_account.service_account] } \ No newline at end of file diff --git a/mmv1/templates/terraform/examples/integrations_client_basic.tf.erb b/mmv1/templates/terraform/examples/integrations_client_basic.tf.erb index 1fc724bcf539..77f4bf717813 100644 --- a/mmv1/templates/terraform/examples/integrations_client_basic.tf.erb +++ b/mmv1/templates/terraform/examples/integrations_client_basic.tf.erb @@ -1,3 +1,4 @@ resource "google_integrations_client" "<%= ctx[:primary_resource_id] %>" { location = "us-central1" + provision_gmek = true } \ No newline at end of file