Skip to content

Commit 67558a9

Browse files
arunsatyarthasatyarth
and
asatyarth
authored
Memorystore Cluster_Disabled : Rename Standalone value in Mode field to Cluster_Disabled (GoogleCloudPlatform#12761)
Co-authored-by: asatyarth <[email protected]>
1 parent 0e9d4ce commit 67558a9

File tree

3 files changed

+68
-62
lines changed

3 files changed

+68
-62
lines changed

mmv1/products/memorystore/Instance.yaml

+64-61
Original file line numberDiff line numberDiff line change
@@ -301,74 +301,77 @@ properties:
301301
description: "Endpoints for the instance."
302302
output: true
303303
item_type:
304-
type: Array
305-
description: "A group of PSC connections. They are created in the same VPC network, one for each service attachment in the cluster."
306-
item_type:
307-
type: NestedObject
308-
properties:
309-
- name: 'pscConnectionId'
310-
type: String
311-
description:
312-
"Output only. The PSC connection id of the forwarding rule connected
313-
to the\nservice attachment. "
314-
output: true
315-
- name: 'ipAddress'
316-
type: String
317-
description:
318-
"Output only. The IP allocated on the consumer network for the
319-
PSC forwarding rule. "
320-
output: true
321-
- name: 'forwardingRule'
322-
type: String
323-
description: "Output only. The URI of the consumer side forwarding rule.\nFormat:\nprojects/{project}/regions/{region}/forwardingRules/{forwarding_rule} "
324-
output: true
325-
- name: 'projectId'
326-
type: String
327-
description:
328-
"Output only. The consumer project_id where the forwarding rule is
329-
created from. "
330-
output: true
331-
- name: 'network'
332-
type: String
333-
description:
334-
"Output only. The consumer network where the IP address resides, in
335-
the form of\nprojects/{project_id}/global/networks/{network_id}. "
336-
output: true
337-
- name: 'serviceAttachment'
338-
type: String
339-
description:
340-
"Output only. The service attachment which is the target of the PSC connection, in the form of
341-
projects/{project-id}/regions/{region}/serviceAttachments/{service-attachment-id}."
342-
output: true
343-
- name: 'pscConnectionStatus'
344-
type: Enum
345-
description:
346-
"Output Only. The status of the PSC connection: whether a connection exists and ACTIVE or it no longer exists.
347-
\n Possible values:\n ACTIVE \n NOT_FOUND"
348-
output: true
349-
enum_values:
350-
- 'ACTIVE'
351-
- 'NOT_FOUND'
352-
- name: 'connectionType'
353-
type: Enum
354-
description:
355-
"Output Only. Type of a PSC Connection.
356-
\n Possible values:\n CONNECTION_TYPE_DISCOVERY \n CONNECTION_TYPE_PRIMARY \n CONNECTION_TYPE_READER"
357-
output: true
358-
enum_values:
359-
- 'CONNECTION_TYPE_READER'
360-
- 'CONNECTION_TYPE_PRIMARY'
361-
- 'CONNECTION_TYPE_DISCOVERY'
304+
type: NestedObject
305+
properties:
306+
- name: 'connections'
307+
type: Array
308+
description: "A group of PSC connections. They are created in the same VPC network, one for each service attachment in the cluster."
309+
item_type:
310+
type: NestedObject
311+
properties:
312+
- name: 'pscAutoConnection'
313+
type: NestedObject
314+
description: "Detailed information of a PSC connection that is created through service connectivity automation."
315+
properties:
316+
- name: 'pscConnectionId'
317+
type: String
318+
description:
319+
"Output only. The PSC connection id of the forwarding rule connected
320+
to the\nservice attachment. "
321+
output: true
322+
- name: 'ipAddress'
323+
type: String
324+
description:
325+
"Output only. The IP allocated on the consumer network for the
326+
PSC forwarding rule. "
327+
output: true
328+
- name: 'forwardingRule'
329+
type: String
330+
description: "Output only. The URI of the consumer side forwarding rule.\nFormat:\nprojects/{project}/regions/{region}/forwardingRules/{forwarding_rule} "
331+
output: true
332+
- name: 'projectId'
333+
type: String
334+
description:
335+
"Output only. The consumer project_id where the forwarding rule is
336+
created from. "
337+
output: true
338+
- name: 'network'
339+
type: String
340+
description:
341+
"Output only. The consumer network where the IP address resides, in
342+
the form of\nprojects/{project_id}/global/networks/{network_id}. "
343+
output: true
344+
- name: 'serviceAttachment'
345+
type: String
346+
description:
347+
"Output only. The service attachment which is the target of the PSC connection, in the form of
348+
projects/{project-id}/regions/{region}/serviceAttachments/{service-attachment-id}."
349+
output: true
350+
- name: 'connectionType'
351+
type: Enum
352+
description:
353+
"Output Only. Type of a PSC Connection.
354+
\n Possible values:\n CONNECTION_TYPE_DISCOVERY \n CONNECTION_TYPE_PRIMARY \n CONNECTION_TYPE_READER"
355+
output: true
356+
enum_values:
357+
- 'CONNECTION_TYPE_READER'
358+
- 'CONNECTION_TYPE_PRIMARY'
359+
- 'CONNECTION_TYPE_DISCOVERY'
360+
- name: 'port'
361+
type: Integer
362+
description:
363+
"Output only. Ports of the exposed endpoint."
364+
output: true
362365
- name: 'mode'
363366
type: Enum
364367
description:
365-
"Optional. Standalone or cluster.
366-
\n Possible values:\n CLUSTER\nSTANDALONE"
368+
"Optional. cluster or cluster-disabled.
369+
\n Possible values:\n CLUSTER\n CLUSTER_DISABLED"
367370
default_from_api: true
368371
immutable: true
369372
enum_values:
370373
- 'CLUSTER'
371-
- 'STANDALONE'
374+
- 'CLUSTER_DISABLED'
372375
- name: 'pscAutoConnections'
373376
type: Array
374377
description:

mmv1/templates/terraform/decoders/memorystore_instance.go.tmpl

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
// Retrieve pscAutoConnections from API response
22
v, ok := res["pscAutoConnections"]
33
if !ok {
4+
if _, endpointsFound := res["endpoints"]; endpointsFound {
5+
return res, nil // For Cluster Disabled instances, we would have 'endpoints' instead of 'pscAutoConnections'
6+
}
47
return nil, fmt.Errorf("pscAutoConnections field not found in API response")
58
}
69

mmv1/templates/terraform/examples/memorystore_instance_standalone_full.tf.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ resource "google_memorystore_instance" "{{$.PrimaryResourceId}}" {
2020
}
2121
engine_version = "VALKEY_7_2"
2222
deletion_protection_enabled = false
23-
mode = "STANDALONE"
23+
mode = "CLUSTER_DISABLED"
2424
persistence_config {
2525
mode = "RDB"
2626
rdb_config {

0 commit comments

Comments
 (0)