From 9e7b4b9244e0611b7595ce1a1ab3a0d678d96e2b Mon Sep 17 00:00:00 2001 From: Simal Cubuk Date: Wed, 1 May 2024 13:15:01 +0000 Subject: [PATCH 01/22] Add a new resource RegionalEndpoint under product networkconnectivity --- .../networkconnectivity/RegionalEndpoint.yaml | 118 ++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 mmv1/products/networkconnectivity/RegionalEndpoint.yaml diff --git a/mmv1/products/networkconnectivity/RegionalEndpoint.yaml b/mmv1/products/networkconnectivity/RegionalEndpoint.yaml new file mode 100644 index 000000000000..6159b7ee3f27 --- /dev/null +++ b/mmv1/products/networkconnectivity/RegionalEndpoint.yaml @@ -0,0 +1,118 @@ +# 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: 'RegionalEndpoint' +description: | + Regional Private Service Connect (PSC) endpoint resource. +references: !ruby/object:Api::Resource::ReferenceLinks + guides: + 'Access regional Google APIs through endpoints': 'https://cloud.google.com/vpc/docs/access-regional-google-apis-endpoints' + api: 'https://cloud.google.com/network-connectivity/docs/reference/networkconnectivity/rest/v1beta/projects.locations.regionalEndpoints' +min_version: beta +base_url: 'projects/{{project}}/locations/{{location}}/regionalEndpoints' +self_link: 'projects/{{project}}/locations/{{location}}/regionalEndpoints/{{name}}' +immutable: true +timeouts: !ruby/object:Api::Timeouts + insert_minutes: 20 + delete_minutes: 20 +create_url: 'projects/{{project}}/locations/{{location}}/regionalEndpoints?regional_endpoint_id={{name}}' +delete_url: 'projects/{{project}}/locations/{{location}}/regionalEndpoints/{{name}}' +autogen_async: true +async: !ruby/object:Api::OpAsync + actions: ['create', 'delete'] + operation: !ruby/object:Api::OpAsync::Operation + base_url: '{{op_id}}' + result: !ruby/object:Api::OpAsync::Result + path: 'response' + status: !ruby/object:Api::OpAsync::Status + path: 'done' + complete: true + allowed: + - true + - false + error: !ruby/object:Api::OpAsync::Error + path: 'error' + message: 'message' + +examples: + - !ruby/object:Provider::Terraform::Examples + name: 'regional_endpoints_regional_access_with_address_input' + primary_resource_id: 'default' + vars: + name: 'my-rep' + target_gogole_api: 'spanner.me-central2.p.rep.googleapis.com' + access_type: 'REGIONAL' + address: 'projects/my-project/regions/my-region/addresses/my-address' + network: 'projects/my-project/global/networks/my-network' + subnetwork: 'projects/my-project/regions/my-region/subnetworks/my-subnetwork' + +parameters: + - !ruby/object:Api::Type::String + name: 'name' + output: true + immutable: true + url_param_only: true + description: | + The name of a RegionalEndpoint. Format: `projects/{project}/locations/{location}/regionalEndpoints/{regional_endpoint}`. + +properties: + - !ruby/object:Api::Type::Time + name: 'createTime' + output: true + description: | + Time when the RegionalEndpoint was created. + - !ruby/object:Api::Type::Time + name: 'updateTime' + output: true + description: | + Time when the RegionalEndpoint was updated. + - !ruby/object:Api::Type::KeyValueLabels + name: 'labels' + description: | + User-defined labels. + - !ruby/object:Api::Type::String + name: 'description' + description: | + A description of this resource. + - !ruby/object:Api::Type::String + name: 'targetGoogleApi' + required: true + description: | + The service endpoint this private regional endpoint connects to. Format: `{apiname}.{region}.p.rep.googleapis.com` Example: \"cloudkms.us-central1.p.rep.googleapis.com\". + - !ruby/object:Api::Type::String + name: 'network' + description: | + The name of the VPC network for this private regional endpoint. Format: `projects/{project}/global/networks/{network}` + - !ruby/object:Api::Type::String + name: 'subnetwork' + description: | + The name of the subnetwork from which the IP address will be allocated. Format: `projects/{project}/regions/{region}/subnetworks/{subnetwork}` + - !ruby/object:Api::Type::Enum + name: accessType + required: true + description: | + The access type of this regional endpoint. This field is reflected in the PSC Forwarding Rule configuration to enable global access. + values: + - :ACCESS_TYPE_UNSPECIFIED + - :GLOBAL + - :REGIONAL + - !ruby/object:Api::Type::String + name: 'pscForwardingRule' + output: true + description: | + The resource reference of the PSC Forwarding Rule created on behalf of the customer. Format: `//compute.googleapis.com/projects/{project}/regions/{region}/forwardingRules/{forwarding_rule_name}` + - !ruby/object:Api::Type::String + name: 'address' + description: | + The IP Address of the Regional Endpoint. When no address is provided, an IP from the subnetwork is allocated. Use one of the following formats: * IPv4 address as in `10.0.0.1` * Address resource URI as in `projects/{project}/regions/{region}/addresses/{address_name}` From f7cd29f19ec8fa8d011bca13923edf6503f67bba Mon Sep 17 00:00:00 2001 From: Simal Cubuk Date: Wed, 1 May 2024 13:36:13 +0000 Subject: [PATCH 02/22] Add a new resource RegionalEndpoint under product networkconnectivity, with v1 --- mmv1/products/networkconnectivity/RegionalEndpoint.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mmv1/products/networkconnectivity/RegionalEndpoint.yaml b/mmv1/products/networkconnectivity/RegionalEndpoint.yaml index 6159b7ee3f27..9681859abe67 100644 --- a/mmv1/products/networkconnectivity/RegionalEndpoint.yaml +++ b/mmv1/products/networkconnectivity/RegionalEndpoint.yaml @@ -18,8 +18,7 @@ description: | references: !ruby/object:Api::Resource::ReferenceLinks guides: 'Access regional Google APIs through endpoints': 'https://cloud.google.com/vpc/docs/access-regional-google-apis-endpoints' - api: 'https://cloud.google.com/network-connectivity/docs/reference/networkconnectivity/rest/v1beta/projects.locations.regionalEndpoints' -min_version: beta + api: 'https://cloud.google.com/network-connectivity/docs/reference/networkconnectivity/rest/v1/projects.locations.regionalEndpoints' base_url: 'projects/{{project}}/locations/{{location}}/regionalEndpoints' self_link: 'projects/{{project}}/locations/{{location}}/regionalEndpoints/{{name}}' immutable: true From c3de0ac96f1fe2359d62238056cafde905a7209b Mon Sep 17 00:00:00 2001 From: Simal Cubuk Date: Wed, 1 May 2024 16:48:29 +0000 Subject: [PATCH 03/22] Add examples for the new resource RegionalEndpoint --- .../networkconnectivity/RegionalEndpoint.yaml | 24 +++++++++++----- ...ity_regional_endpoint_global_access.tf.erb | 28 +++++++++++++++++++ ...y_regional_endpoint_regional_access.tf.erb | 0 3 files changed, 45 insertions(+), 7 deletions(-) create mode 100644 mmv1/templates/terraform/examples/network_connectivity_regional_endpoint_global_access.tf.erb create mode 100644 mmv1/templates/terraform/examples/network_connectivity_regional_endpoint_regional_access.tf.erb diff --git a/mmv1/products/networkconnectivity/RegionalEndpoint.yaml b/mmv1/products/networkconnectivity/RegionalEndpoint.yaml index 9681859abe67..a15602d16364 100644 --- a/mmv1/products/networkconnectivity/RegionalEndpoint.yaml +++ b/mmv1/products/networkconnectivity/RegionalEndpoint.yaml @@ -46,15 +46,25 @@ async: !ruby/object:Api::OpAsync examples: - !ruby/object:Provider::Terraform::Examples - name: 'regional_endpoints_regional_access_with_address_input' + name: 'regional_endpoints_regional_access' primary_resource_id: 'default' vars: - name: 'my-rep' - target_gogole_api: 'spanner.me-central2.p.rep.googleapis.com' - access_type: 'REGIONAL' - address: 'projects/my-project/regions/my-region/addresses/my-address' - network: 'projects/my-project/global/networks/my-network' - subnetwork: 'projects/my-project/regions/my-region/subnetworks/my-subnetwork' + rep_name: 'my-rep' + rep_target_google_api: 'spanner.me-central2.p.rep.googleapis.com' + rep_access_type: 'REGIONAL' + rep_address: 'my-address' + rep_network: 'my-network' + rep_subnetwork: 'my-subnetwork' + - !ruby/object:Provider::Terraform::Examples + name: 'regional_endpoints_global_access' + primary_resource_id: 'default' + vars: + rep_name: 'my-rep' + rep_target_google_api: 'spanner.me-central2.p.rep.googleapis.com' + rep_access_type: 'GLOBAL' + rep_address: 'my-address' + rep_network: 'my-network' + rep_subnetwork: 'my-subnetwork' parameters: - !ruby/object:Api::Type::String diff --git a/mmv1/templates/terraform/examples/network_connectivity_regional_endpoint_global_access.tf.erb b/mmv1/templates/terraform/examples/network_connectivity_regional_endpoint_global_access.tf.erb new file mode 100644 index 000000000000..15a6eb1c5764 --- /dev/null +++ b/mmv1/templates/terraform/examples/network_connectivity_regional_endpoint_global_access.tf.erb @@ -0,0 +1,28 @@ +resource "google_compute_network" "my_network" { + name = "<%= ctx[:vars]['rep_network'] %>" + auto_create_subnetworks = false +} + +resource "google_compute_subnetwork" "my_subnetwork" { + name = "<%= ctx[:vars]['rep_subnetwork'] %>" + ip_cidr_range = "10.0.0.0/16" + region = "us-central1" + network = google_compute_network.my_network.id +} + +resource "google_compute_address" "my_address" { + name = "<%= ctx[:vars]['rep_address'] %>" + region = "us-central1" + subnetwork = google_compute_subnetwork.my_subnetwork.id + purpose = "GCE_ENDPOINT" + ip-version = "IPV4" +} + +resource "google_network_connectivity_regional_endpoint" "<%= ctx[:primary_resource_id] %>" { + name = "<%= ctx[:vars]['rep_name'] %>" + target_google_api = "<%= ctx[:vars]['rep_target_gogole_api'] %>" + access_type = "GLOBAL" + address = google_compute_address.my_address.id + network = google_compute_network.my_network.id + subnetwork = google_compute_subnetwork.my_subnetwork.id +} diff --git a/mmv1/templates/terraform/examples/network_connectivity_regional_endpoint_regional_access.tf.erb b/mmv1/templates/terraform/examples/network_connectivity_regional_endpoint_regional_access.tf.erb new file mode 100644 index 000000000000..e69de29bb2d1 From a4a2ac5439351cbbfbc39cfc2cf665e7c8352dee Mon Sep 17 00:00:00 2001 From: Simal Cubuk Date: Wed, 1 May 2024 16:50:58 +0000 Subject: [PATCH 04/22] Add examples for regional access for the new resource RegionalEndpoint --- ...y_regional_endpoint_regional_access.tf.erb | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/mmv1/templates/terraform/examples/network_connectivity_regional_endpoint_regional_access.tf.erb b/mmv1/templates/terraform/examples/network_connectivity_regional_endpoint_regional_access.tf.erb index e69de29bb2d1..a9f6ca65be53 100644 --- a/mmv1/templates/terraform/examples/network_connectivity_regional_endpoint_regional_access.tf.erb +++ b/mmv1/templates/terraform/examples/network_connectivity_regional_endpoint_regional_access.tf.erb @@ -0,0 +1,28 @@ +resource "google_compute_network" "my_network" { + name = "<%= ctx[:vars]['rep_network'] %>" + auto_create_subnetworks = false +} + +resource "google_compute_subnetwork" "my_subnetwork" { + name = "<%= ctx[:vars]['rep_subnetwork'] %>" + ip_cidr_range = "10.0.0.0/16" + region = "us-central1" + network = google_compute_network.my_network.id +} + +resource "google_compute_address" "my_address" { + name = "<%= ctx[:vars]['rep_address'] %>" + region = "us-central1" + subnetwork = google_compute_subnetwork.my_subnetwork.id + purpose = "GCE_ENDPOINT" + ip-version = "IPV4" +} + +resource "google_network_connectivity_regional_endpoint" "<%= ctx[:primary_resource_id] %>" { + name = "<%= ctx[:vars]['rep_name'] %>" + target_google_api = "<%= ctx[:vars]['rep_target_gogole_api'] %>" + access_type = "REGIONAL" + address = google_compute_address.my_address.id + network = google_compute_network.my_network.id + subnetwork = google_compute_subnetwork.my_subnetwork.id +} From 39b0a62b3375b1d62f9ef500581c51da50bf1d51 Mon Sep 17 00:00:00 2001 From: Simal Cubuk Date: Wed, 1 May 2024 16:54:00 +0000 Subject: [PATCH 05/22] Fix example names --- mmv1/products/networkconnectivity/RegionalEndpoint.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mmv1/products/networkconnectivity/RegionalEndpoint.yaml b/mmv1/products/networkconnectivity/RegionalEndpoint.yaml index a15602d16364..7f8c1493e029 100644 --- a/mmv1/products/networkconnectivity/RegionalEndpoint.yaml +++ b/mmv1/products/networkconnectivity/RegionalEndpoint.yaml @@ -46,7 +46,7 @@ async: !ruby/object:Api::OpAsync examples: - !ruby/object:Provider::Terraform::Examples - name: 'regional_endpoints_regional_access' + name: 'network_connectivity_regional_endpoints_regional_access' primary_resource_id: 'default' vars: rep_name: 'my-rep' @@ -56,7 +56,7 @@ examples: rep_network: 'my-network' rep_subnetwork: 'my-subnetwork' - !ruby/object:Provider::Terraform::Examples - name: 'regional_endpoints_global_access' + name: 'network_connectivity_regional_endpoints_global_access' primary_resource_id: 'default' vars: rep_name: 'my-rep' From bb0765f052ab537f3defe2c34fc39c844466b840 Mon Sep 17 00:00:00 2001 From: Simal Cubuk Date: Wed, 1 May 2024 16:56:17 +0000 Subject: [PATCH 06/22] Change regional_endpoints to regional_endpoint --- mmv1/products/networkconnectivity/RegionalEndpoint.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mmv1/products/networkconnectivity/RegionalEndpoint.yaml b/mmv1/products/networkconnectivity/RegionalEndpoint.yaml index 7f8c1493e029..ae944e653614 100644 --- a/mmv1/products/networkconnectivity/RegionalEndpoint.yaml +++ b/mmv1/products/networkconnectivity/RegionalEndpoint.yaml @@ -46,7 +46,7 @@ async: !ruby/object:Api::OpAsync examples: - !ruby/object:Provider::Terraform::Examples - name: 'network_connectivity_regional_endpoints_regional_access' + name: 'network_connectivity_regional_endpoint_regional_access' primary_resource_id: 'default' vars: rep_name: 'my-rep' @@ -56,7 +56,7 @@ examples: rep_network: 'my-network' rep_subnetwork: 'my-subnetwork' - !ruby/object:Provider::Terraform::Examples - name: 'network_connectivity_regional_endpoints_global_access' +name: 'network_connectivity_regional_endpoint_global_access' primary_resource_id: 'default' vars: rep_name: 'my-rep' From 0d10826f6f94c62d99b7a19dafd88f752e97a97c Mon Sep 17 00:00:00 2001 From: Simal Cubuk Date: Wed, 1 May 2024 17:59:43 +0000 Subject: [PATCH 07/22] Fix [key-duplicates] duplication of key name in mapping --- mmv1/products/networkconnectivity/RegionalEndpoint.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mmv1/products/networkconnectivity/RegionalEndpoint.yaml b/mmv1/products/networkconnectivity/RegionalEndpoint.yaml index ae944e653614..1dd8f922b45a 100644 --- a/mmv1/products/networkconnectivity/RegionalEndpoint.yaml +++ b/mmv1/products/networkconnectivity/RegionalEndpoint.yaml @@ -56,7 +56,7 @@ examples: rep_network: 'my-network' rep_subnetwork: 'my-subnetwork' - !ruby/object:Provider::Terraform::Examples -name: 'network_connectivity_regional_endpoint_global_access' + name: 'network_connectivity_regional_endpoint_global_access' primary_resource_id: 'default' vars: rep_name: 'my-rep' From 41d8a70f984ce7649eb2d61c24ff31086811ea87 Mon Sep 17 00:00:00 2001 From: Simal Cubuk Date: Wed, 1 May 2024 18:26:18 +0000 Subject: [PATCH 08/22] Fix acceptance tests. Make ip-verion, ip_version --- .../network_connectivity_regional_endpoint_global_access.tf.erb | 2 +- ...etwork_connectivity_regional_endpoint_regional_access.tf.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mmv1/templates/terraform/examples/network_connectivity_regional_endpoint_global_access.tf.erb b/mmv1/templates/terraform/examples/network_connectivity_regional_endpoint_global_access.tf.erb index 15a6eb1c5764..ef0b216ebe04 100644 --- a/mmv1/templates/terraform/examples/network_connectivity_regional_endpoint_global_access.tf.erb +++ b/mmv1/templates/terraform/examples/network_connectivity_regional_endpoint_global_access.tf.erb @@ -15,7 +15,7 @@ resource "google_compute_address" "my_address" { region = "us-central1" subnetwork = google_compute_subnetwork.my_subnetwork.id purpose = "GCE_ENDPOINT" - ip-version = "IPV4" + ip_version = "IPV4" } resource "google_network_connectivity_regional_endpoint" "<%= ctx[:primary_resource_id] %>" { diff --git a/mmv1/templates/terraform/examples/network_connectivity_regional_endpoint_regional_access.tf.erb b/mmv1/templates/terraform/examples/network_connectivity_regional_endpoint_regional_access.tf.erb index a9f6ca65be53..2a6bf0463415 100644 --- a/mmv1/templates/terraform/examples/network_connectivity_regional_endpoint_regional_access.tf.erb +++ b/mmv1/templates/terraform/examples/network_connectivity_regional_endpoint_regional_access.tf.erb @@ -15,7 +15,7 @@ resource "google_compute_address" "my_address" { region = "us-central1" subnetwork = google_compute_subnetwork.my_subnetwork.id purpose = "GCE_ENDPOINT" - ip-version = "IPV4" + ip_version = "IPV4" } resource "google_network_connectivity_regional_endpoint" "<%= ctx[:primary_resource_id] %>" { From 0e56f08e2a41712b31297574a471c413dd6ef578 Mon Sep 17 00:00:00 2001 From: Simal Cubuk Date: Wed, 1 May 2024 18:46:23 +0000 Subject: [PATCH 09/22] Fix acceptance tests. Add values for description, labels and project. --- ...twork_connectivity_regional_endpoint_regional_access.tf.erb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mmv1/templates/terraform/examples/network_connectivity_regional_endpoint_regional_access.tf.erb b/mmv1/templates/terraform/examples/network_connectivity_regional_endpoint_regional_access.tf.erb index 2a6bf0463415..edee6f0b2a35 100644 --- a/mmv1/templates/terraform/examples/network_connectivity_regional_endpoint_regional_access.tf.erb +++ b/mmv1/templates/terraform/examples/network_connectivity_regional_endpoint_regional_access.tf.erb @@ -25,4 +25,7 @@ resource "google_network_connectivity_regional_endpoint" "<%= ctx[:primary_resou address = google_compute_address.my_address.id network = google_compute_network.my_network.id subnetwork = google_compute_subnetwork.my_subnetwork.id + description = "My RegionalEndpoint targeting Google API spanner.me-central2.p.rep.googleapis.com" + labels = {env = "default"} + project = "my-project" } From a14f799c4391ef9cab88461d541023b1900dd4db Mon Sep 17 00:00:00 2001 From: Simal Cubuk Date: Wed, 1 May 2024 19:19:04 +0000 Subject: [PATCH 10/22] Fix acceptance tests. Don't assign value for output only fields, name. --- .../network_connectivity_regional_endpoint_global_access.tf.erb | 1 - ...network_connectivity_regional_endpoint_regional_access.tf.erb | 1 - 2 files changed, 2 deletions(-) diff --git a/mmv1/templates/terraform/examples/network_connectivity_regional_endpoint_global_access.tf.erb b/mmv1/templates/terraform/examples/network_connectivity_regional_endpoint_global_access.tf.erb index ef0b216ebe04..fcdae5c171f5 100644 --- a/mmv1/templates/terraform/examples/network_connectivity_regional_endpoint_global_access.tf.erb +++ b/mmv1/templates/terraform/examples/network_connectivity_regional_endpoint_global_access.tf.erb @@ -19,7 +19,6 @@ resource "google_compute_address" "my_address" { } resource "google_network_connectivity_regional_endpoint" "<%= ctx[:primary_resource_id] %>" { - name = "<%= ctx[:vars]['rep_name'] %>" target_google_api = "<%= ctx[:vars]['rep_target_gogole_api'] %>" access_type = "GLOBAL" address = google_compute_address.my_address.id diff --git a/mmv1/templates/terraform/examples/network_connectivity_regional_endpoint_regional_access.tf.erb b/mmv1/templates/terraform/examples/network_connectivity_regional_endpoint_regional_access.tf.erb index edee6f0b2a35..e0fee037f1bd 100644 --- a/mmv1/templates/terraform/examples/network_connectivity_regional_endpoint_regional_access.tf.erb +++ b/mmv1/templates/terraform/examples/network_connectivity_regional_endpoint_regional_access.tf.erb @@ -19,7 +19,6 @@ resource "google_compute_address" "my_address" { } resource "google_network_connectivity_regional_endpoint" "<%= ctx[:primary_resource_id] %>" { - name = "<%= ctx[:vars]['rep_name'] %>" target_google_api = "<%= ctx[:vars]['rep_target_gogole_api'] %>" access_type = "REGIONAL" address = google_compute_address.my_address.id From 6b354a6eac8871f52eb004ea3baf3be1f3b4d55b Mon Sep 17 00:00:00 2001 From: Simal Cubuk Date: Wed, 1 May 2024 21:08:33 +0000 Subject: [PATCH 11/22] Fix address_type in google_compute_address resources in tests --- ...onnectivity_regional_endpoint_global_access.tf.erb | 1 + ...nectivity_regional_endpoint_regional_access.tf.erb | 11 ++++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/mmv1/templates/terraform/examples/network_connectivity_regional_endpoint_global_access.tf.erb b/mmv1/templates/terraform/examples/network_connectivity_regional_endpoint_global_access.tf.erb index fcdae5c171f5..283c270c530d 100644 --- a/mmv1/templates/terraform/examples/network_connectivity_regional_endpoint_global_access.tf.erb +++ b/mmv1/templates/terraform/examples/network_connectivity_regional_endpoint_global_access.tf.erb @@ -14,6 +14,7 @@ resource "google_compute_address" "my_address" { name = "<%= ctx[:vars]['rep_address'] %>" region = "us-central1" subnetwork = google_compute_subnetwork.my_subnetwork.id + address_type = "INTERNAL" purpose = "GCE_ENDPOINT" ip_version = "IPV4" } diff --git a/mmv1/templates/terraform/examples/network_connectivity_regional_endpoint_regional_access.tf.erb b/mmv1/templates/terraform/examples/network_connectivity_regional_endpoint_regional_access.tf.erb index e0fee037f1bd..5df75024af20 100644 --- a/mmv1/templates/terraform/examples/network_connectivity_regional_endpoint_regional_access.tf.erb +++ b/mmv1/templates/terraform/examples/network_connectivity_regional_endpoint_regional_access.tf.erb @@ -11,11 +11,12 @@ resource "google_compute_subnetwork" "my_subnetwork" { } resource "google_compute_address" "my_address" { - name = "<%= ctx[:vars]['rep_address'] %>" - region = "us-central1" - subnetwork = google_compute_subnetwork.my_subnetwork.id - purpose = "GCE_ENDPOINT" - ip_version = "IPV4" + name = "<%= ctx[:vars]['rep_address'] %>" + region = "us-central1" + subnetwork = google_compute_subnetwork.my_subnetwork.id + address_type = "INTERNAL" + purpose = "GCE_ENDPOINT" + ip_version = "IPV4" } resource "google_network_connectivity_regional_endpoint" "<%= ctx[:primary_resource_id] %>" { From 6177ad1d7f49977bdc510d8d42ee2d73d9b66014 Mon Sep 17 00:00:00 2001 From: Simal Cubuk Date: Wed, 1 May 2024 22:06:50 +0000 Subject: [PATCH 12/22] Remove unnecessary field declarations in RegionalEndpoint.yaml, fix tests --- .../networkconnectivity/RegionalEndpoint.yaml | 13 +++++++------ ...ctivity_regional_endpoint_regional_access.tf.erb | 1 - 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/mmv1/products/networkconnectivity/RegionalEndpoint.yaml b/mmv1/products/networkconnectivity/RegionalEndpoint.yaml index 1dd8f922b45a..bc85140c97e9 100644 --- a/mmv1/products/networkconnectivity/RegionalEndpoint.yaml +++ b/mmv1/products/networkconnectivity/RegionalEndpoint.yaml @@ -22,9 +22,6 @@ references: !ruby/object:Api::Resource::ReferenceLinks base_url: 'projects/{{project}}/locations/{{location}}/regionalEndpoints' self_link: 'projects/{{project}}/locations/{{location}}/regionalEndpoints/{{name}}' immutable: true -timeouts: !ruby/object:Api::Timeouts - insert_minutes: 20 - delete_minutes: 20 create_url: 'projects/{{project}}/locations/{{location}}/regionalEndpoints?regional_endpoint_id={{name}}' delete_url: 'projects/{{project}}/locations/{{location}}/regionalEndpoints/{{name}}' autogen_async: true @@ -49,7 +46,6 @@ examples: name: 'network_connectivity_regional_endpoint_regional_access' primary_resource_id: 'default' vars: - rep_name: 'my-rep' rep_target_google_api: 'spanner.me-central2.p.rep.googleapis.com' rep_access_type: 'REGIONAL' rep_address: 'my-address' @@ -59,7 +55,6 @@ examples: name: 'network_connectivity_regional_endpoint_global_access' primary_resource_id: 'default' vars: - rep_name: 'my-rep' rep_target_google_api: 'spanner.me-central2.p.rep.googleapis.com' rep_access_type: 'GLOBAL' rep_address: 'my-address' @@ -74,6 +69,13 @@ parameters: url_param_only: true description: | The name of a RegionalEndpoint. Format: `projects/{project}/locations/{location}/regionalEndpoints/{regional_endpoint}`. + - !ruby/object:Api::Type::String + name: 'location' + required: true + immutable: true + url_param_only: true + description: | + The location of the RegionalEndpoint. properties: - !ruby/object:Api::Type::Time @@ -113,7 +115,6 @@ properties: description: | The access type of this regional endpoint. This field is reflected in the PSC Forwarding Rule configuration to enable global access. values: - - :ACCESS_TYPE_UNSPECIFIED - :GLOBAL - :REGIONAL - !ruby/object:Api::Type::String diff --git a/mmv1/templates/terraform/examples/network_connectivity_regional_endpoint_regional_access.tf.erb b/mmv1/templates/terraform/examples/network_connectivity_regional_endpoint_regional_access.tf.erb index 5df75024af20..e11ead7124de 100644 --- a/mmv1/templates/terraform/examples/network_connectivity_regional_endpoint_regional_access.tf.erb +++ b/mmv1/templates/terraform/examples/network_connectivity_regional_endpoint_regional_access.tf.erb @@ -27,5 +27,4 @@ resource "google_network_connectivity_regional_endpoint" "<%= ctx[:primary_resou subnetwork = google_compute_subnetwork.my_subnetwork.id description = "My RegionalEndpoint targeting Google API spanner.me-central2.p.rep.googleapis.com" labels = {env = "default"} - project = "my-project" } From 0a82096eed3101161516f3698d6d95737e1a1033 Mon Sep 17 00:00:00 2001 From: Simal Cubuk Date: Wed, 1 May 2024 22:21:46 +0000 Subject: [PATCH 13/22] remove output=true from parameter. fix tests. --- mmv1/products/networkconnectivity/RegionalEndpoint.yaml | 7 +++---- ...ork_connectivity_regional_endpoint_global_access.tf.erb | 1 + ...k_connectivity_regional_endpoint_regional_access.tf.erb | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/mmv1/products/networkconnectivity/RegionalEndpoint.yaml b/mmv1/products/networkconnectivity/RegionalEndpoint.yaml index bc85140c97e9..2f15bcc4ce58 100644 --- a/mmv1/products/networkconnectivity/RegionalEndpoint.yaml +++ b/mmv1/products/networkconnectivity/RegionalEndpoint.yaml @@ -46,8 +46,8 @@ examples: name: 'network_connectivity_regional_endpoint_regional_access' primary_resource_id: 'default' vars: + rep_name: 'my-rep' rep_target_google_api: 'spanner.me-central2.p.rep.googleapis.com' - rep_access_type: 'REGIONAL' rep_address: 'my-address' rep_network: 'my-network' rep_subnetwork: 'my-subnetwork' @@ -55,8 +55,8 @@ examples: name: 'network_connectivity_regional_endpoint_global_access' primary_resource_id: 'default' vars: + rep_name: 'my-rep' rep_target_google_api: 'spanner.me-central2.p.rep.googleapis.com' - rep_access_type: 'GLOBAL' rep_address: 'my-address' rep_network: 'my-network' rep_subnetwork: 'my-subnetwork' @@ -64,11 +64,10 @@ examples: parameters: - !ruby/object:Api::Type::String name: 'name' - output: true immutable: true url_param_only: true description: | - The name of a RegionalEndpoint. Format: `projects/{project}/locations/{location}/regionalEndpoints/{regional_endpoint}`. + The name of the RegionalEndpoint. - !ruby/object:Api::Type::String name: 'location' required: true diff --git a/mmv1/templates/terraform/examples/network_connectivity_regional_endpoint_global_access.tf.erb b/mmv1/templates/terraform/examples/network_connectivity_regional_endpoint_global_access.tf.erb index 283c270c530d..94f9e3c95135 100644 --- a/mmv1/templates/terraform/examples/network_connectivity_regional_endpoint_global_access.tf.erb +++ b/mmv1/templates/terraform/examples/network_connectivity_regional_endpoint_global_access.tf.erb @@ -20,6 +20,7 @@ resource "google_compute_address" "my_address" { } resource "google_network_connectivity_regional_endpoint" "<%= ctx[:primary_resource_id] %>" { + name = "<%= ctx[:vars]['rep_name'] %>" target_google_api = "<%= ctx[:vars]['rep_target_gogole_api'] %>" access_type = "GLOBAL" address = google_compute_address.my_address.id diff --git a/mmv1/templates/terraform/examples/network_connectivity_regional_endpoint_regional_access.tf.erb b/mmv1/templates/terraform/examples/network_connectivity_regional_endpoint_regional_access.tf.erb index e11ead7124de..90a8718be121 100644 --- a/mmv1/templates/terraform/examples/network_connectivity_regional_endpoint_regional_access.tf.erb +++ b/mmv1/templates/terraform/examples/network_connectivity_regional_endpoint_regional_access.tf.erb @@ -20,6 +20,7 @@ resource "google_compute_address" "my_address" { } resource "google_network_connectivity_regional_endpoint" "<%= ctx[:primary_resource_id] %>" { + name = "<%= ctx[:vars]['rep_name'] %>" target_google_api = "<%= ctx[:vars]['rep_target_gogole_api'] %>" access_type = "REGIONAL" address = google_compute_address.my_address.id From 2cb46b0ef0e26cb7124b7dec04404977b9665acc Mon Sep 17 00:00:00 2001 From: Simal Cubuk Date: Wed, 1 May 2024 22:33:56 +0000 Subject: [PATCH 14/22] add to the examples --- .../network_connectivity_regional_endpoint_global_access.tf.erb | 1 + ...network_connectivity_regional_endpoint_regional_access.tf.erb | 1 + 2 files changed, 2 insertions(+) diff --git a/mmv1/templates/terraform/examples/network_connectivity_regional_endpoint_global_access.tf.erb b/mmv1/templates/terraform/examples/network_connectivity_regional_endpoint_global_access.tf.erb index 94f9e3c95135..158a6da23a0b 100644 --- a/mmv1/templates/terraform/examples/network_connectivity_regional_endpoint_global_access.tf.erb +++ b/mmv1/templates/terraform/examples/network_connectivity_regional_endpoint_global_access.tf.erb @@ -21,6 +21,7 @@ resource "google_compute_address" "my_address" { resource "google_network_connectivity_regional_endpoint" "<%= ctx[:primary_resource_id] %>" { name = "<%= ctx[:vars]['rep_name'] %>" + location = "us-central1" target_google_api = "<%= ctx[:vars]['rep_target_gogole_api'] %>" access_type = "GLOBAL" address = google_compute_address.my_address.id diff --git a/mmv1/templates/terraform/examples/network_connectivity_regional_endpoint_regional_access.tf.erb b/mmv1/templates/terraform/examples/network_connectivity_regional_endpoint_regional_access.tf.erb index 90a8718be121..b9758c5f87da 100644 --- a/mmv1/templates/terraform/examples/network_connectivity_regional_endpoint_regional_access.tf.erb +++ b/mmv1/templates/terraform/examples/network_connectivity_regional_endpoint_regional_access.tf.erb @@ -21,6 +21,7 @@ resource "google_compute_address" "my_address" { resource "google_network_connectivity_regional_endpoint" "<%= ctx[:primary_resource_id] %>" { name = "<%= ctx[:vars]['rep_name'] %>" + location = "us-central1" target_google_api = "<%= ctx[:vars]['rep_target_gogole_api'] %>" access_type = "REGIONAL" address = google_compute_address.my_address.id From df669ddf55631acba0e1a1f29da3f4a818dbd44b Mon Sep 17 00:00:00 2001 From: Simal Cubuk Date: Thu, 2 May 2024 00:19:48 +0000 Subject: [PATCH 15/22] hardcode target-google-api field in tests --- mmv1/products/networkconnectivity/RegionalEndpoint.yaml | 2 -- .../network_connectivity_regional_endpoint_global_access.tf.erb | 2 +- ...etwork_connectivity_regional_endpoint_regional_access.tf.erb | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/mmv1/products/networkconnectivity/RegionalEndpoint.yaml b/mmv1/products/networkconnectivity/RegionalEndpoint.yaml index 2f15bcc4ce58..d63eb3ca3521 100644 --- a/mmv1/products/networkconnectivity/RegionalEndpoint.yaml +++ b/mmv1/products/networkconnectivity/RegionalEndpoint.yaml @@ -47,7 +47,6 @@ examples: primary_resource_id: 'default' vars: rep_name: 'my-rep' - rep_target_google_api: 'spanner.me-central2.p.rep.googleapis.com' rep_address: 'my-address' rep_network: 'my-network' rep_subnetwork: 'my-subnetwork' @@ -56,7 +55,6 @@ examples: primary_resource_id: 'default' vars: rep_name: 'my-rep' - rep_target_google_api: 'spanner.me-central2.p.rep.googleapis.com' rep_address: 'my-address' rep_network: 'my-network' rep_subnetwork: 'my-subnetwork' diff --git a/mmv1/templates/terraform/examples/network_connectivity_regional_endpoint_global_access.tf.erb b/mmv1/templates/terraform/examples/network_connectivity_regional_endpoint_global_access.tf.erb index 158a6da23a0b..65ac19ab1369 100644 --- a/mmv1/templates/terraform/examples/network_connectivity_regional_endpoint_global_access.tf.erb +++ b/mmv1/templates/terraform/examples/network_connectivity_regional_endpoint_global_access.tf.erb @@ -22,7 +22,7 @@ resource "google_compute_address" "my_address" { resource "google_network_connectivity_regional_endpoint" "<%= ctx[:primary_resource_id] %>" { name = "<%= ctx[:vars]['rep_name'] %>" location = "us-central1" - target_google_api = "<%= ctx[:vars]['rep_target_gogole_api'] %>" + target_google_api = "spanner.me-central2.p.rep.googleapis.com" access_type = "GLOBAL" address = google_compute_address.my_address.id network = google_compute_network.my_network.id diff --git a/mmv1/templates/terraform/examples/network_connectivity_regional_endpoint_regional_access.tf.erb b/mmv1/templates/terraform/examples/network_connectivity_regional_endpoint_regional_access.tf.erb index b9758c5f87da..fbb17367c141 100644 --- a/mmv1/templates/terraform/examples/network_connectivity_regional_endpoint_regional_access.tf.erb +++ b/mmv1/templates/terraform/examples/network_connectivity_regional_endpoint_regional_access.tf.erb @@ -22,7 +22,7 @@ resource "google_compute_address" "my_address" { resource "google_network_connectivity_regional_endpoint" "<%= ctx[:primary_resource_id] %>" { name = "<%= ctx[:vars]['rep_name'] %>" location = "us-central1" - target_google_api = "<%= ctx[:vars]['rep_target_gogole_api'] %>" + target_google_api = "spanner.me-central2.p.rep.googleapis.com" access_type = "REGIONAL" address = google_compute_address.my_address.id network = google_compute_network.my_network.id From 579a95ac1e8946ea8202fcce8078d6fc6d7500b1 Mon Sep 17 00:00:00 2001 From: Simal Cubuk Date: Thu, 2 May 2024 04:14:30 +0000 Subject: [PATCH 16/22] fix region in target-google-api --- ...etwork_connectivity_regional_endpoint_global_access.tf.erb | 2 +- ...work_connectivity_regional_endpoint_regional_access.tf.erb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mmv1/templates/terraform/examples/network_connectivity_regional_endpoint_global_access.tf.erb b/mmv1/templates/terraform/examples/network_connectivity_regional_endpoint_global_access.tf.erb index 65ac19ab1369..ac6a921ed73d 100644 --- a/mmv1/templates/terraform/examples/network_connectivity_regional_endpoint_global_access.tf.erb +++ b/mmv1/templates/terraform/examples/network_connectivity_regional_endpoint_global_access.tf.erb @@ -22,7 +22,7 @@ resource "google_compute_address" "my_address" { resource "google_network_connectivity_regional_endpoint" "<%= ctx[:primary_resource_id] %>" { name = "<%= ctx[:vars]['rep_name'] %>" location = "us-central1" - target_google_api = "spanner.me-central2.p.rep.googleapis.com" + target_google_api = "boqcodelabjaimin-pa.us-central1.p.rep.googleapis.com" access_type = "GLOBAL" address = google_compute_address.my_address.id network = google_compute_network.my_network.id diff --git a/mmv1/templates/terraform/examples/network_connectivity_regional_endpoint_regional_access.tf.erb b/mmv1/templates/terraform/examples/network_connectivity_regional_endpoint_regional_access.tf.erb index fbb17367c141..48465bb4a87e 100644 --- a/mmv1/templates/terraform/examples/network_connectivity_regional_endpoint_regional_access.tf.erb +++ b/mmv1/templates/terraform/examples/network_connectivity_regional_endpoint_regional_access.tf.erb @@ -22,11 +22,11 @@ resource "google_compute_address" "my_address" { resource "google_network_connectivity_regional_endpoint" "<%= ctx[:primary_resource_id] %>" { name = "<%= ctx[:vars]['rep_name'] %>" location = "us-central1" - target_google_api = "spanner.me-central2.p.rep.googleapis.com" + target_google_api = "boqcodelabjaimin-pa.us-central1.p.rep.googleapis.com" access_type = "REGIONAL" address = google_compute_address.my_address.id network = google_compute_network.my_network.id subnetwork = google_compute_subnetwork.my_subnetwork.id - description = "My RegionalEndpoint targeting Google API spanner.me-central2.p.rep.googleapis.com" + description = "My RegionalEndpoint targeting Google API boqcodelabjaimin-pa.us-central1.p.rep.googleapis.com" labels = {env = "default"} } From cd85a92755426b95851afb6680910431cac008e4 Mon Sep 17 00:00:00 2001 From: Simal Cubuk Date: Thu, 2 May 2024 18:00:49 +0000 Subject: [PATCH 17/22] remove address input from tests due to complications regarding ipVersion field --- .../networkconnectivity/RegionalEndpoint.yaml | 2 -- ...nectivity_regional_endpoint_global_access.tf.erb | 13 ++----------- ...ctivity_regional_endpoint_regional_access.tf.erb | 13 ++----------- 3 files changed, 4 insertions(+), 24 deletions(-) diff --git a/mmv1/products/networkconnectivity/RegionalEndpoint.yaml b/mmv1/products/networkconnectivity/RegionalEndpoint.yaml index d63eb3ca3521..59e1cc3fdbe9 100644 --- a/mmv1/products/networkconnectivity/RegionalEndpoint.yaml +++ b/mmv1/products/networkconnectivity/RegionalEndpoint.yaml @@ -47,7 +47,6 @@ examples: primary_resource_id: 'default' vars: rep_name: 'my-rep' - rep_address: 'my-address' rep_network: 'my-network' rep_subnetwork: 'my-subnetwork' - !ruby/object:Provider::Terraform::Examples @@ -55,7 +54,6 @@ examples: primary_resource_id: 'default' vars: rep_name: 'my-rep' - rep_address: 'my-address' rep_network: 'my-network' rep_subnetwork: 'my-subnetwork' diff --git a/mmv1/templates/terraform/examples/network_connectivity_regional_endpoint_global_access.tf.erb b/mmv1/templates/terraform/examples/network_connectivity_regional_endpoint_global_access.tf.erb index ac6a921ed73d..b730a0b27ba7 100644 --- a/mmv1/templates/terraform/examples/network_connectivity_regional_endpoint_global_access.tf.erb +++ b/mmv1/templates/terraform/examples/network_connectivity_regional_endpoint_global_access.tf.erb @@ -5,26 +5,17 @@ resource "google_compute_network" "my_network" { resource "google_compute_subnetwork" "my_subnetwork" { name = "<%= ctx[:vars]['rep_subnetwork'] %>" - ip_cidr_range = "10.0.0.0/16" + ip_cidr_range = "192.168.0.0/24" region = "us-central1" network = google_compute_network.my_network.id } -resource "google_compute_address" "my_address" { - name = "<%= ctx[:vars]['rep_address'] %>" - region = "us-central1" - subnetwork = google_compute_subnetwork.my_subnetwork.id - address_type = "INTERNAL" - purpose = "GCE_ENDPOINT" - ip_version = "IPV4" -} - resource "google_network_connectivity_regional_endpoint" "<%= ctx[:primary_resource_id] %>" { name = "<%= ctx[:vars]['rep_name'] %>" location = "us-central1" target_google_api = "boqcodelabjaimin-pa.us-central1.p.rep.googleapis.com" access_type = "GLOBAL" - address = google_compute_address.my_address.id + address = "192.168.0.4" network = google_compute_network.my_network.id subnetwork = google_compute_subnetwork.my_subnetwork.id } diff --git a/mmv1/templates/terraform/examples/network_connectivity_regional_endpoint_regional_access.tf.erb b/mmv1/templates/terraform/examples/network_connectivity_regional_endpoint_regional_access.tf.erb index 48465bb4a87e..10e947d698eb 100644 --- a/mmv1/templates/terraform/examples/network_connectivity_regional_endpoint_regional_access.tf.erb +++ b/mmv1/templates/terraform/examples/network_connectivity_regional_endpoint_regional_access.tf.erb @@ -5,26 +5,17 @@ resource "google_compute_network" "my_network" { resource "google_compute_subnetwork" "my_subnetwork" { name = "<%= ctx[:vars]['rep_subnetwork'] %>" - ip_cidr_range = "10.0.0.0/16" + ip_cidr_range = "192.168.0.0/24" region = "us-central1" network = google_compute_network.my_network.id } -resource "google_compute_address" "my_address" { - name = "<%= ctx[:vars]['rep_address'] %>" - region = "us-central1" - subnetwork = google_compute_subnetwork.my_subnetwork.id - address_type = "INTERNAL" - purpose = "GCE_ENDPOINT" - ip_version = "IPV4" -} - resource "google_network_connectivity_regional_endpoint" "<%= ctx[:primary_resource_id] %>" { name = "<%= ctx[:vars]['rep_name'] %>" location = "us-central1" target_google_api = "boqcodelabjaimin-pa.us-central1.p.rep.googleapis.com" access_type = "REGIONAL" - address = google_compute_address.my_address.id + address = "192.168.0.5" network = google_compute_network.my_network.id subnetwork = google_compute_subnetwork.my_subnetwork.id description = "My RegionalEndpoint targeting Google API boqcodelabjaimin-pa.us-central1.p.rep.googleapis.com" From 6f42cbbb4a76a20d44de431a2a981c20f514c00f Mon Sep 17 00:00:00 2001 From: Simal Cubuk Date: Thu, 2 May 2024 18:04:53 +0000 Subject: [PATCH 18/22] add default_from_api: true to address field --- mmv1/products/networkconnectivity/RegionalEndpoint.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/mmv1/products/networkconnectivity/RegionalEndpoint.yaml b/mmv1/products/networkconnectivity/RegionalEndpoint.yaml index 59e1cc3fdbe9..a7395f4dddb5 100644 --- a/mmv1/products/networkconnectivity/RegionalEndpoint.yaml +++ b/mmv1/products/networkconnectivity/RegionalEndpoint.yaml @@ -121,3 +121,4 @@ properties: name: 'address' description: | The IP Address of the Regional Endpoint. When no address is provided, an IP from the subnetwork is allocated. Use one of the following formats: * IPv4 address as in `10.0.0.1` * Address resource URI as in `projects/{project}/regions/{region}/addresses/{address_name}` + default_from_api: true From 78a94be9e0774504127e1a85ce7ab9c14515bfa1 Mon Sep 17 00:00:00 2001 From: Simal Cubuk Date: Thu, 2 May 2024 18:43:47 +0000 Subject: [PATCH 19/22] Add default_from_api: true for network and subnetwork fields --- mmv1/products/networkconnectivity/RegionalEndpoint.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mmv1/products/networkconnectivity/RegionalEndpoint.yaml b/mmv1/products/networkconnectivity/RegionalEndpoint.yaml index a7395f4dddb5..750b5416a716 100644 --- a/mmv1/products/networkconnectivity/RegionalEndpoint.yaml +++ b/mmv1/products/networkconnectivity/RegionalEndpoint.yaml @@ -100,10 +100,12 @@ properties: name: 'network' description: | The name of the VPC network for this private regional endpoint. Format: `projects/{project}/global/networks/{network}` + default_from_api: true - !ruby/object:Api::Type::String name: 'subnetwork' description: | The name of the subnetwork from which the IP address will be allocated. Format: `projects/{project}/regions/{region}/subnetworks/{subnetwork}` + default_from_api: true - !ruby/object:Api::Type::Enum name: accessType required: true From 27dbdf09e552ac6f52ce93d1795f6c2d5a604594 Mon Sep 17 00:00:00 2001 From: Simal Cubuk Date: Thu, 2 May 2024 19:06:08 +0000 Subject: [PATCH 20/22] Add a note for the address field --- mmv1/products/networkconnectivity/RegionalEndpoint.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mmv1/products/networkconnectivity/RegionalEndpoint.yaml b/mmv1/products/networkconnectivity/RegionalEndpoint.yaml index 750b5416a716..30e7443f94c0 100644 --- a/mmv1/products/networkconnectivity/RegionalEndpoint.yaml +++ b/mmv1/products/networkconnectivity/RegionalEndpoint.yaml @@ -123,4 +123,6 @@ properties: name: 'address' description: | The IP Address of the Regional Endpoint. When no address is provided, an IP from the subnetwork is allocated. Use one of the following formats: * IPv4 address as in `10.0.0.1` * Address resource URI as in `projects/{project}/regions/{region}/addresses/{address_name}` + + ~> **Note:** This field accepts both a reference to a Compute Address resource, which is the resource name of which format is given in the description, and IP literal value. If the user chooses to input a reserved address value; they need to make sure that the reserved address is in IPv4 version, its purpose is GCE_ENDPOINT, its type is INTERNAL and its status is RESERVED. If the user chooses to input an IP literal, they need to make sure that it's a valid IPv4 address (x.x.x.x) within the subnetwork. default_from_api: true From 5cc1fab27063b7c5c9efee9accef7222a248ec59 Mon Sep 17 00:00:00 2001 From: Simal Cubuk Date: Thu, 2 May 2024 19:09:03 +0000 Subject: [PATCH 21/22] Remove trailing space from RegionalEndpoint --- mmv1/products/networkconnectivity/RegionalEndpoint.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mmv1/products/networkconnectivity/RegionalEndpoint.yaml b/mmv1/products/networkconnectivity/RegionalEndpoint.yaml index 30e7443f94c0..0a1d7db418e0 100644 --- a/mmv1/products/networkconnectivity/RegionalEndpoint.yaml +++ b/mmv1/products/networkconnectivity/RegionalEndpoint.yaml @@ -123,6 +123,6 @@ properties: name: 'address' description: | The IP Address of the Regional Endpoint. When no address is provided, an IP from the subnetwork is allocated. Use one of the following formats: * IPv4 address as in `10.0.0.1` * Address resource URI as in `projects/{project}/regions/{region}/addresses/{address_name}` - + ~> **Note:** This field accepts both a reference to a Compute Address resource, which is the resource name of which format is given in the description, and IP literal value. If the user chooses to input a reserved address value; they need to make sure that the reserved address is in IPv4 version, its purpose is GCE_ENDPOINT, its type is INTERNAL and its status is RESERVED. If the user chooses to input an IP literal, they need to make sure that it's a valid IPv4 address (x.x.x.x) within the subnetwork. default_from_api: true From 377dd7a795131ea34c90ca0a8091bc50479eedc4 Mon Sep 17 00:00:00 2001 From: Simal Cubuk Date: Thu, 2 May 2024 19:58:44 +0000 Subject: [PATCH 22/22] Make name field required --- mmv1/products/networkconnectivity/RegionalEndpoint.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/mmv1/products/networkconnectivity/RegionalEndpoint.yaml b/mmv1/products/networkconnectivity/RegionalEndpoint.yaml index 0a1d7db418e0..9f0dd05125a2 100644 --- a/mmv1/products/networkconnectivity/RegionalEndpoint.yaml +++ b/mmv1/products/networkconnectivity/RegionalEndpoint.yaml @@ -60,6 +60,7 @@ examples: parameters: - !ruby/object:Api::Type::String name: 'name' + required: true immutable: true url_param_only: true description: |