diff --git a/mmv1/products/integrations/Client.yaml b/mmv1/products/integrations/Client.yaml index af65456395bc..9cc18cf1794e 100644 --- a/mmv1/products/integrations/Client.yaml +++ b/mmv1/products/integrations/Client.yaml @@ -34,6 +34,7 @@ import_format: mutex: Client/{{location}} custom_code: !ruby/object:Provider::Terraform::CustomCode decoder: templates/terraform/decoders/integrations_client.go.erb + pre_create: templates/terraform/pre_create/integrations_client.go.erb parameters: - !ruby/object:Api::Type::String name: 'location' @@ -83,18 +84,34 @@ properties: the kms key is stored at the same project as customer's project and ecrypted with CMEK, otherwise, the kms key is stored in the tenant project and encrypted with GMEK. + conflicts: + - provision_gmek - !ruby/object:Api::Type::Boolean name: 'createSampleWorkflows' description: | Indicates if sample workflow should be created along with provisioning. immutable: true ignore_read: true + deprecation_message: "`create_sample_workflows` is deprecated and will be removed in a future major release. Use `create_sample_integrations` instead." + conflicts: + - create_sample_integrations + - !ruby/object:Api::Type::Boolean + name: 'createSampleIntegrations' + description: | + Indicates if sample integrations should be created along with provisioning. + immutable: true + ignore_read: true + conflicts: + - create_sample_workflows - !ruby/object:Api::Type::Boolean name: 'provisionGmek' description: | Indicates provision with GMEK or CMEK. + deprecation_message: "`provision_gmek` is deprecated and will be removed in a future major release. Client would be provisioned as gmek if `cloud_kms_config` is not given." immutable: true ignore_read: true + conflicts: + - cloud_kms_config - !ruby/object:Api::Type::String name: 'runAsServiceAccount' description: | @@ -106,8 +123,12 @@ examples: name: "integrations_client_basic" primary_resource_id: "example" - !ruby/object:Provider::Terraform::Examples - name: "integrations_client_advance" + name: "integrations_client_full" primary_resource_id: "example" skip_vcr: true vars: key_ring_name: my-keyring + - !ruby/object:Provider::Terraform::Examples + name: "integrations_client_deprecated_fields" + primary_resource_id: "example" + skip_docs: true diff --git a/mmv1/templates/terraform/examples/integrations_auth_config_advance.tf.erb b/mmv1/templates/terraform/examples/integrations_auth_config_advance.tf.erb index d0aeb4c13158..d0f9ccb50233 100644 --- a/mmv1/templates/terraform/examples/integrations_auth_config_advance.tf.erb +++ b/mmv1/templates/terraform/examples/integrations_auth_config_advance.tf.erb @@ -1,6 +1,5 @@ resource "google_integrations_client" "client" { location = "asia-east2" - provision_gmek = true } resource "google_integrations_auth_config" "<%= ctx[:primary_resource_id] %>" { diff --git a/mmv1/templates/terraform/examples/integrations_auth_config_auth_token.tf.erb b/mmv1/templates/terraform/examples/integrations_auth_config_auth_token.tf.erb index b9f2e7892548..6444f0b21d56 100644 --- a/mmv1/templates/terraform/examples/integrations_auth_config_auth_token.tf.erb +++ b/mmv1/templates/terraform/examples/integrations_auth_config_auth_token.tf.erb @@ -1,6 +1,5 @@ resource "google_integrations_client" "client" { location = "us-west2" - provision_gmek = true } resource "google_integrations_auth_config" "<%= ctx[:primary_resource_id] %>" { diff --git a/mmv1/templates/terraform/examples/integrations_auth_config_basic.tf.erb b/mmv1/templates/terraform/examples/integrations_auth_config_basic.tf.erb index 13b1a5be514a..54393f47ef6a 100644 --- a/mmv1/templates/terraform/examples/integrations_auth_config_basic.tf.erb +++ b/mmv1/templates/terraform/examples/integrations_auth_config_basic.tf.erb @@ -1,6 +1,5 @@ resource "google_integrations_client" "client" { location = "us-west1" - provision_gmek = true } resource "google_integrations_auth_config" "<%= ctx[:primary_resource_id] %>" { diff --git a/mmv1/templates/terraform/examples/integrations_auth_config_client_certificate_only.tf.erb b/mmv1/templates/terraform/examples/integrations_auth_config_client_certificate_only.tf.erb index 95707a3a4a0f..9fc84c2f466b 100644 --- a/mmv1/templates/terraform/examples/integrations_auth_config_client_certificate_only.tf.erb +++ b/mmv1/templates/terraform/examples/integrations_auth_config_client_certificate_only.tf.erb @@ -1,6 +1,5 @@ resource "google_integrations_client" "client" { location = "us-west3" - provision_gmek = true } resource "google_integrations_auth_config" "<%= ctx[:primary_resource_id] %>" { diff --git a/mmv1/templates/terraform/examples/integrations_auth_config_jwt.tf.erb b/mmv1/templates/terraform/examples/integrations_auth_config_jwt.tf.erb index 255158776eef..b1dbc3c7165e 100644 --- a/mmv1/templates/terraform/examples/integrations_auth_config_jwt.tf.erb +++ b/mmv1/templates/terraform/examples/integrations_auth_config_jwt.tf.erb @@ -1,6 +1,5 @@ resource "google_integrations_client" "client" { location = "us-west4" - provision_gmek = true } resource "google_integrations_auth_config" "<%= ctx[:primary_resource_id] %>" { diff --git a/mmv1/templates/terraform/examples/integrations_auth_config_oauth2_authorization_code.tf.erb b/mmv1/templates/terraform/examples/integrations_auth_config_oauth2_authorization_code.tf.erb index d51cf5563ac9..6cc6c256044d 100644 --- a/mmv1/templates/terraform/examples/integrations_auth_config_oauth2_authorization_code.tf.erb +++ b/mmv1/templates/terraform/examples/integrations_auth_config_oauth2_authorization_code.tf.erb @@ -1,6 +1,5 @@ resource "google_integrations_client" "client" { location = "asia-east1" - provision_gmek = true } resource "google_integrations_auth_config" "<%= ctx[:primary_resource_id] %>" { diff --git a/mmv1/templates/terraform/examples/integrations_auth_config_oauth2_client_credentials.tf.erb b/mmv1/templates/terraform/examples/integrations_auth_config_oauth2_client_credentials.tf.erb index 8683a5d94413..6d40bf1f5b68 100644 --- a/mmv1/templates/terraform/examples/integrations_auth_config_oauth2_client_credentials.tf.erb +++ b/mmv1/templates/terraform/examples/integrations_auth_config_oauth2_client_credentials.tf.erb @@ -1,6 +1,5 @@ resource "google_integrations_client" "client" { location = "southamerica-east1" - provision_gmek = true } resource "google_integrations_auth_config" "<%= ctx[:primary_resource_id] %>" { diff --git a/mmv1/templates/terraform/examples/integrations_auth_config_oidc_token.tf.erb b/mmv1/templates/terraform/examples/integrations_auth_config_oidc_token.tf.erb index c4714366144d..9292e02ca31d 100644 --- a/mmv1/templates/terraform/examples/integrations_auth_config_oidc_token.tf.erb +++ b/mmv1/templates/terraform/examples/integrations_auth_config_oidc_token.tf.erb @@ -1,6 +1,5 @@ resource "google_integrations_client" "client" { location = "us-south1" - provision_gmek = true } resource "google_service_account" "service_account" { diff --git a/mmv1/templates/terraform/examples/integrations_auth_config_service_account.tf.erb b/mmv1/templates/terraform/examples/integrations_auth_config_service_account.tf.erb index 2408065c04a2..676014ca7cca 100644 --- a/mmv1/templates/terraform/examples/integrations_auth_config_service_account.tf.erb +++ b/mmv1/templates/terraform/examples/integrations_auth_config_service_account.tf.erb @@ -1,6 +1,5 @@ resource "google_integrations_client" "client" { location = "northamerica-northeast1" - provision_gmek = true } resource "google_service_account" "service_account" { diff --git a/mmv1/templates/terraform/examples/integrations_auth_config_username_and_password.tf.erb b/mmv1/templates/terraform/examples/integrations_auth_config_username_and_password.tf.erb index d7283675acc4..5168aef8cc41 100644 --- a/mmv1/templates/terraform/examples/integrations_auth_config_username_and_password.tf.erb +++ b/mmv1/templates/terraform/examples/integrations_auth_config_username_and_password.tf.erb @@ -1,6 +1,5 @@ resource "google_integrations_client" "client" { location = "northamerica-northeast2" - provision_gmek = true } resource "google_integrations_auth_config" "<%= ctx[:primary_resource_id] %>" { diff --git a/mmv1/templates/terraform/examples/integrations_client_basic.tf.erb b/mmv1/templates/terraform/examples/integrations_client_basic.tf.erb index 77f4bf717813..1fc724bcf539 100644 --- a/mmv1/templates/terraform/examples/integrations_client_basic.tf.erb +++ b/mmv1/templates/terraform/examples/integrations_client_basic.tf.erb @@ -1,4 +1,3 @@ resource "google_integrations_client" "<%= ctx[:primary_resource_id] %>" { location = "us-central1" - provision_gmek = true } \ No newline at end of file diff --git a/mmv1/templates/terraform/examples/integrations_client_deprecated_fields.tf.erb b/mmv1/templates/terraform/examples/integrations_client_deprecated_fields.tf.erb new file mode 100644 index 000000000000..ccac00b1f5f5 --- /dev/null +++ b/mmv1/templates/terraform/examples/integrations_client_deprecated_fields.tf.erb @@ -0,0 +1,5 @@ +resource "google_integrations_client" "<%= ctx[:primary_resource_id] %>" { + location = "asia-south1" + provision_gmek = true + create_sample_workflows = true +} \ No newline at end of file diff --git a/mmv1/templates/terraform/examples/integrations_client_advance.tf.erb b/mmv1/templates/terraform/examples/integrations_client_full.tf.erb similarity index 81% rename from mmv1/templates/terraform/examples/integrations_client_advance.tf.erb rename to mmv1/templates/terraform/examples/integrations_client_full.tf.erb index f874971cd2fa..cf125c39d5ce 100644 --- a/mmv1/templates/terraform/examples/integrations_client_advance.tf.erb +++ b/mmv1/templates/terraform/examples/integrations_client_full.tf.erb @@ -10,12 +10,10 @@ resource "google_kms_crypto_key" "cryptokey" { name = "crypto-key-example" key_ring = google_kms_key_ring.keyring.id rotation_period = "7776000s" - depends_on = [google_kms_key_ring.keyring] } resource "google_kms_crypto_key_version" "test_key" { crypto_key = google_kms_crypto_key.cryptokey.id - depends_on = [google_kms_crypto_key.cryptokey] } resource "google_service_account" "service_account" { @@ -25,7 +23,7 @@ resource "google_service_account" "service_account" { resource "google_integrations_client" "<%= ctx[:primary_resource_id] %>" { location = "us-east1" - create_sample_workflows = true + create_sample_integrations = true run_as_service_account = google_service_account.service_account.email cloud_kms_config { kms_location = "us-east1" @@ -34,5 +32,4 @@ resource "google_integrations_client" "<%= ctx[:primary_resource_id] %>" { key_version = google_kms_crypto_key_version.test_key.id kms_project_id = data.google_project.test_project.project_id } - 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/pre_create/integrations_client.go.erb b/mmv1/templates/terraform/pre_create/integrations_client.go.erb new file mode 100644 index 000000000000..8e40faf8ba58 --- /dev/null +++ b/mmv1/templates/terraform/pre_create/integrations_client.go.erb @@ -0,0 +1,5 @@ +// Translate `createSampleIntegrations` to `createSampleWorkflows` +if val, ok := obj["createSampleIntegrations"]; ok { + delete(obj, "createSampleIntegrations") + obj["createSampleWorkflows"] = val +} \ No newline at end of file