Skip to content

Commit 7da3c8b

Browse files
committed
Fixing based on PR comments
1 parent 8d44d7b commit 7da3c8b

6 files changed

+21
-25
lines changed

mmv1/products/memorystore/Instance.yaml

-5
Original file line numberDiff line numberDiff line change
@@ -398,11 +398,6 @@ properties:
398398
description:
399399
"Service attachment URI which your self-created PscConnection should use as target."
400400
output: true
401-
- name: 'dnsName'
402-
type: String
403-
description:
404-
"The PSC endpoint IP address"
405-
output: true
406401
- name: 'connectionType'
407402
type: String
408403
description:

mmv1/products/memorystore/InstanceDesiredUserCreatedConnections.yaml renamed to mmv1/products/memorystore/InstanceDesiredUserCreatedEndpoints.yaml

+7-7
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
# limitations under the License.
1313

1414
---
15-
name: 'InstanceDesiredUserCreatedConnections'
16-
api_resource_type_kind: Cluster
15+
name: 'InstanceDesiredUserCreatedEndpoints'
16+
api_resource_type_kind: Instance
1717
description: |
1818
Manages user created connections for Memorystore instance
1919
docs:
@@ -35,7 +35,7 @@ update_verb: 'PATCH'
3535
update_url: 'projects/{{project}}/locations/{{region}}/instances/{{name}}?updateMask=endpoints'
3636
update_mask: true
3737
custom_code:
38-
custom_delete: 'templates/terraform/custom_delete/memorystore_instance_desired_user_created_connections.go.tmpl'
38+
custom_delete: 'templates/terraform/custom_delete/memorystore_instance_desired_user_created_endpoints.go.tmpl'
3939
timeouts:
4040
insert_minutes: 60
4141
update_minutes: 120
@@ -49,7 +49,7 @@ async:
4949
result:
5050
resource_inside_response: false
5151
examples:
52-
- name: 'memorystore_instance_desired_user_created_connections'
52+
- name: 'memorystore_instance_desired_user_created_endpoints'
5353
primary_resource_id: 'instance-user-conn'
5454
vars:
5555
instance_name: 'instance-user-conn'
@@ -65,7 +65,7 @@ examples:
6565
ip2_network2_name: 'ip2-net2'
6666
forwarding_rule1_network2_name: 'fwd1-net2'
6767
forwarding_rule2_network2_name: 'fwd2-net2'
68-
- name: 'memorystore_instance_desired_user_and_auto_created_connections'
68+
- name: 'memorystore_instance_desired_user_and_auto_created_endpoints'
6969
primary_resource_id: 'instance-user-auto-conn'
7070
vars:
7171
instance_name: 'instance-user-auto-conn'
@@ -92,10 +92,10 @@ parameters:
9292
url_param_only: true
9393
required: true
9494
properties:
95-
- name: 'desiredUserEndpoints'
95+
- name: 'desiredUserCreatedEndpoints'
9696
api_name: 'endpoints'
9797
type: Array
98-
description: "A list of instance endpoints"
98+
description: "A list of desired user endpoints"
9999
custom_flatten: 'templates/terraform/custom_flatten/memorystore_instance_desired_user_created_connections_desired_endpoints.go.tmpl'
100100
item_type:
101101
type: NestedObject
+3-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
billingProject = project
88

99
obj := make(map[string]interface{})
10-
// not setting instanceEndpoints in obj
10+
// not setting desiredUserCreatedEndpoints in obj
1111

1212

1313
url, err := tpgresource.ReplaceVars(d, config, "{{"{{"}}MemorystoreBasePath{{"}}"}}projects/{{"{{"}}project{{"}}"}}/locations/{{"{{"}}region{{"}}"}}/instances/{{"{{"}}name{{"}}"}}")
@@ -20,6 +20,7 @@
2020

2121
updateMask := []string{}
2222
updateMask = append(updateMask, "endpoints")
23+
// endpoints maps to desiredUserCreatedEndpoints on the resource
2324
// updateMask is a URL parameter but not present in the schema, so ReplaceVars
2425
// won't set it
2526
url, err = transport_tpg.AddQueryParams(url, map[string]string{"updateMask": strings.Join(updateMask, ",")})
@@ -61,4 +62,4 @@
6162
return err
6263
}
6364
}
64-
return resourceMemorystoreInstanceDesiredUserCreatedConnectionsRead(d, meta)
65+
return resourceMemorystoreInstanceDesiredUserCreatedEndpointsRead(d, meta)
+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
resource "google_memorystore_instance_desired_user_created_connections" "{{$.PrimaryResourceId}}" {
1+
resource "google_memorystore_instance_desired_user_created_endpoints" "{{$.PrimaryResourceId}}" {
22
name = "{{index $.Vars "instance_name"}}"
33
region = "us-central1"
4-
desired_user_endpoints {
4+
desired_user_created_endpoints {
55
connections {
66
psc_connection {
77
psc_connection_id = google_compute_forwarding_rule.forwarding_rule1_network2.psc_connection_id

mmv1/templates/terraform/examples/memorystore_instance_desired_user_created_connections.tf.tmpl renamed to mmv1/templates/terraform/examples/memorystore_instance_desired_user_created_endpoints.tf.tmpl

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
resource "google_memorystore_instance_desired_user_created_connections" "{{$.PrimaryResourceId}}" {
1+
resource "google_memorystore_instance_desired_user_created_endpoints" "{{$.PrimaryResourceId}}" {
22
name = "{{index $.Vars "instance_name"}}"
33
region = "us-central1"
4-
desired_user_endpoints {
4+
desired_user_created_endpoints {
55
connections {
66
psc_connection {
77
psc_connection_id = google_compute_forwarding_rule.forwarding_rule1_network2.psc_connection_id
@@ -21,7 +21,7 @@ resource "google_memorystore_instance_desired_user_created_connections" "{{$.Pri
2121
}
2222
}
2323
}
24-
desired_user_endpoints {
24+
desired_user_created_endpoints {
2525
connections {
2626
psc_connection {
2727
psc_connection_id = google_compute_forwarding_rule.forwarding_rule1_network2.psc_connection_id

mmv1/third_party/terraform/services/memorystore/resource_memorystore_instance_test.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -352,11 +352,11 @@ type InstanceParams struct {
352352

353353
func createMemorystoreInstanceEndpointsWithOneUserCreatedConnections(params *InstanceParams) string {
354354
return fmt.Sprintf(`
355-
resource "google_memorystore_instance_desired_user_created_connections" "default" {
355+
resource "google_memorystore_instance_desired_user_created_endpoints" "default" {
356356
357357
name = "%s"
358358
region = "europe-west1"
359-
desired_user_endpoints {
359+
desired_user_created_endpoints {
360360
connections {
361361
psc_connection {
362362
psc_connection_id = google_compute_forwarding_rule.forwarding_rule1_network1.psc_connection_id
@@ -367,7 +367,7 @@ func createMemorystoreInstanceEndpointsWithOneUserCreatedConnections(params *Ins
367367
service_attachment = google_memorystore_instance.test.psc_attachment_details[0].service_attachment
368368
}
369369
}
370-
desired_user_endpoints {
370+
desired_user_created_endpoints {
371371
psc_connection {
372372
psc_connection_id = google_compute_forwarding_rule.forwarding_rule2_network1.psc_connection_id
373373
ip_address = google_compute_address.ip2_network1.address
@@ -388,10 +388,10 @@ func createMemorystoreInstanceEndpointsWithOneUserCreatedConnections(params *Ins
388388

389389
func createMemorystoreInstanceEndpointsWithTwoUserCreatedConnections(params *InstanceParams) string {
390390
return fmt.Sprintf(`
391-
resource "google_memorystore_instance_desired_user_created_connections" "default" {
391+
resource "google_memorystore_instance_desired_user_created_endpoints" "default" {
392392
name = "%s"
393393
region = "europe-west1"
394-
desired_user_endpoints {
394+
desired_user_created_endpoints {
395395
connections {
396396
psc_connection {
397397
psc_connection_id = google_compute_forwarding_rule.forwarding_rule1_network1.psc_connection_id
@@ -412,7 +412,7 @@ func createMemorystoreInstanceEndpointsWithTwoUserCreatedConnections(params *Ins
412412
}
413413
}
414414
}
415-
desired_user_endpoints {
415+
desired_user_created_endpoints {
416416
connections {
417417
psc_connection {
418418
psc_connection_id = google_compute_forwarding_rule.forwarding_rule1_network2.psc_connection_id

0 commit comments

Comments
 (0)