Skip to content

Commit

Permalink
Deprecate createSampleWorkflows and provisionGmek fields. Add createS…
Browse files Browse the repository at this point in the history
…ampleIntegrations (GoogleCloudPlatform#10478)
  • Loading branch information
rohitjangid committed Apr 24, 2024
1 parent 6ea6f33 commit 41c94af
Show file tree
Hide file tree
Showing 15 changed files with 33 additions and 16 deletions.
23 changes: 22 additions & 1 deletion mmv1/products/integrations/Client.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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: |
Expand All @@ -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
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
resource "google_integrations_client" "client" {
location = "asia-east2"
provision_gmek = true
}

resource "google_integrations_auth_config" "<%= ctx[:primary_resource_id] %>" {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
resource "google_integrations_client" "client" {
location = "us-west2"
provision_gmek = true
}

resource "google_integrations_auth_config" "<%= ctx[:primary_resource_id] %>" {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
resource "google_integrations_client" "client" {
location = "us-west1"
provision_gmek = true
}

resource "google_integrations_auth_config" "<%= ctx[:primary_resource_id] %>" {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
resource "google_integrations_client" "client" {
location = "us-west3"
provision_gmek = true
}

resource "google_integrations_auth_config" "<%= ctx[:primary_resource_id] %>" {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
resource "google_integrations_client" "client" {
location = "us-west4"
provision_gmek = true
}

resource "google_integrations_auth_config" "<%= ctx[:primary_resource_id] %>" {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
resource "google_integrations_client" "client" {
location = "asia-east1"
provision_gmek = true
}

resource "google_integrations_auth_config" "<%= ctx[:primary_resource_id] %>" {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
resource "google_integrations_client" "client" {
location = "southamerica-east1"
provision_gmek = true
}

resource "google_integrations_auth_config" "<%= ctx[:primary_resource_id] %>" {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
resource "google_integrations_client" "client" {
location = "us-south1"
provision_gmek = true
}

resource "google_service_account" "service_account" {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
resource "google_integrations_client" "client" {
location = "northamerica-northeast1"
provision_gmek = true
}

resource "google_service_account" "service_account" {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
resource "google_integrations_client" "client" {
location = "northamerica-northeast2"
provision_gmek = true
}

resource "google_integrations_auth_config" "<%= ctx[:primary_resource_id] %>" {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
resource "google_integrations_client" "<%= ctx[:primary_resource_id] %>" {
location = "us-central1"
provision_gmek = true
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
resource "google_integrations_client" "<%= ctx[:primary_resource_id] %>" {
location = "asia-south1"
provision_gmek = true
create_sample_workflows = true
}
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand All @@ -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"
Expand All @@ -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]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Translate `createSampleIntegrations` to `createSampleWorkflows`
if val, ok := obj["createSampleIntegrations"]; ok {
delete(obj, "createSampleIntegrations")
obj["createSampleWorkflows"] = val
}

0 comments on commit 41c94af

Please sign in to comment.