From 67b8b9757a6eb23f0215422cbfeb6e01e4b4d704 Mon Sep 17 00:00:00 2001 From: Rohit Jangid Date: Wed, 13 Mar 2024 14:52:04 +0530 Subject: [PATCH] Add integrations product. Create Client resource. --- mmv1/products/integrations/Client.yaml | 95 +++++++++++++++++++ mmv1/products/integrations/product.yaml | 29 ++++++ .../examples/integrations_client_basic.tf.erb | 3 + 3 files changed, 127 insertions(+) create mode 100644 mmv1/products/integrations/Client.yaml create mode 100644 mmv1/products/integrations/product.yaml create mode 100644 mmv1/templates/terraform/examples/integrations_client_basic.tf.erb diff --git a/mmv1/products/integrations/Client.yaml b/mmv1/products/integrations/Client.yaml new file mode 100644 index 000000000000..4affec55e83f --- /dev/null +++ b/mmv1/products/integrations/Client.yaml @@ -0,0 +1,95 @@ +# Copyright 2024 Google Inc. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +--- !ruby/object:Api::Resource +name: 'Client' +description: | + Application Integration Client. +references: !ruby/object:Api::Resource::ReferenceLinks + guides: + 'Official Documentation': 'https://cloud.google.com/application-integration/docs/overview' + 'Set up Application Integration': 'https://cloud.google.com/application-integration/docs/setup-application-integration' + api: 'https://cloud.google.com/application-integration/docs/reference/rest/v1/projects.locations.clients' +base_url: 'projects/{{project}}/locations/{{location}}/clients' +self_link: 'projects/{{project}}/locations/{{location}}/clients' +immutable: true +create_url: 'projects/{{project}}/locations/{{location}}/clients:provision' +autogen_async: false +skip_delete: true +import_format: + [ + 'projects/{{project}}/locations/{{location}}/clients', + ] +parameters: + - !ruby/object:Api::Type::String + name: 'location' + required: true + immutable: true + url_param_only: true + description: | + Location in which client needs to be provisioned. +properties: + - !ruby/object:Api::Type::NestedObject + name: 'cloudKmsConfig' + description: | + Cloud KMS config for AuthModule to encrypt/decrypt credentials. + properties: + - !ruby/object:Api::Type::String + name: "kmsLocation" + required: true + description: | + Location name of the key ring, e.g. "us-west1". + - !ruby/object:Api::Type::String + name: "kmsRing" + required: true + description: | + A key ring organizes keys in a specific Google Cloud location and allows you to + manage access control on groups of keys. A key ring's name does not need to be + unique across a Google Cloud project, but must be unique within a given location. + - !ruby/object:Api::Type::String + name: "key" + required: true + description: | + A Cloud KMS key is a named object containing one or more key versions, along + with metadata for the key. A key exists on exactly one key ring tied to a + specific location. + - !ruby/object:Api::Type::String + name: "keyVersion" + description: | + Each version of a key contains key material used for encryption or signing. + A key's version is represented by an integer, starting at 1. To decrypt data + or verify a signature, you must use the same key version that was used to + encrypt or sign the data. + - !ruby/object:Api::Type::String + name: "kmsProjectId" + description: | + The Google Cloud project id of the project where the kms key stored. If empty, + 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. + - !ruby/object:Api::Type::Boolean + name: 'createSampleWorkflows' + description: | + Indicates if sample workflow should be created along with provisioning. + - !ruby/object:Api::Type::Boolean + name: 'provisionGmek' + description: | + Indicates provision with GMEK or CMEK. + - !ruby/object:Api::Type::String + name: 'runAsServiceAccount' + description: | + User input run-as service account, if empty, will bring up a new default service account. +examples: + - !ruby/object:Provider::Terraform::Examples + name: "integrations_client_basic" + primary_resource_id: "basic" diff --git a/mmv1/products/integrations/product.yaml b/mmv1/products/integrations/product.yaml new file mode 100644 index 000000000000..8b6908402b11 --- /dev/null +++ b/mmv1/products/integrations/product.yaml @@ -0,0 +1,29 @@ +# Copyright 2020 Google Inc. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +--- !ruby/object:Api::Product +name: Integrations +display_name: Application Integration +versions: + - !ruby/object:Api::Product::Version + name: ga + base_url: https://integrations.googleapis.com/v1/ + # Integrations has no beta API, but running the full Terraform + # acceptance tests depends on a beta-only resource and a bug in MM + # will generate beta tests against the GA provider in this case, so + # we fake a beta API with the same endpoint as the GA API. + - !ruby/object:Api::Product::Version + name: beta + base_url: https://integrations.googleapis.com/v1/ +scopes: + - https://www.googleapis.com/auth/cloud-platform diff --git a/mmv1/templates/terraform/examples/integrations_client_basic.tf.erb b/mmv1/templates/terraform/examples/integrations_client_basic.tf.erb new file mode 100644 index 000000000000..1fc724bcf539 --- /dev/null +++ b/mmv1/templates/terraform/examples/integrations_client_basic.tf.erb @@ -0,0 +1,3 @@ +resource "google_integrations_client" "<%= ctx[:primary_resource_id] %>" { + location = "us-central1" +} \ No newline at end of file