Skip to content

Commit 9625c12

Browse files
authored
chore: Update variable's order for redis memorystore (#253)
1 parent ebef4be commit 9625c12

File tree

8 files changed

+215
-186
lines changed

8 files changed

+215
-186
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ docker_test_lint:
7777
.PHONY: docker_generate_docs
7878
docker_generate_docs:
7979
docker run --rm -it \
80+
-e ENABLE_BPMETADATA \
8081
-v "$(CURDIR)":/workspace \
8182
$(REGISTRY_URL)/${DOCKER_IMAGE_DEVELOPER_TOOLS}:${DOCKER_TAG_VERSION_DEVELOPER_TOOLS} \
8283
/bin/bash -c 'source /usr/local/bin/task_helper_functions.sh && generate_docs'

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ module "memorystore" {
6060
| redis\_configs | The Redis configuration parameters. See [more details](https://cloud.google.com/memorystore/docs/redis/reference/rest/v1/projects.locations.instances#Instance.FIELDS.redis_configs) | `map(any)` | `{}` | no |
6161
| redis\_version | The version of Redis software. | `string` | `null` | no |
6262
| region | The GCP region to use. | `string` | `null` | no |
63-
| replica\_count | The number of replicas. can | `number` | `null` | no |
63+
| replica\_count | The number of replicas. | `number` | `null` | no |
6464
| reserved\_ip\_range | The CIDR range of internal addresses that are reserved for this instance. | `string` | `null` | no |
6565
| secondary\_ip\_range | Optional. Additional IP range for node placement. Required when enabling read replicas on an existing instance. | `string` | `null` | no |
6666
| tier | The service tier of the instance. https://cloud.google.com/memorystore/docs/redis/reference/rest/v1/projects.locations.instances#Tier | `string` | `"STANDARD_HA"` | no |

metadata.display.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,18 @@ spec:
3636
authorized_network:
3737
name: authorized_network
3838
title: Authorized Network
39+
invisible: false
3940
connect_mode:
4041
name: connect_mode
4142
title: Connect Mode
43+
invisible: false
4244
customer_managed_key:
4345
name: customer_managed_key
4446
title: Customer Managed Key
4547
display_name:
4648
name: display_name
4749
title: Display Name
50+
invisible: false
4851
enable_apis:
4952
name: enable_apis
5053
title: Enable Apis
@@ -60,9 +63,12 @@ spec:
6063
memory_size_gb:
6164
name: memory_size_gb
6265
title: Memory Size Gb
66+
invisible: false
6367
name:
6468
name: name
6569
title: Name
70+
regexValidation: ^[a-z][a-z0-9-]{0,38}[a-z0-9]$
71+
validation: Use lowercase letters, numbers, and hyphens. Start with a letter and end with letter/number. Must be 40 characters or fewer.
6672
persistence_config:
6773
name: persistence_config
6874
title: Persistence Config
@@ -78,12 +84,15 @@ spec:
7884
redis_version:
7985
name: redis_version
8086
title: Redis Version
87+
invisible: false
8188
region:
8289
name: region
8390
title: Region
91+
invisible: false
8492
replica_count:
8593
name: replica_count
8694
title: Replica Count
95+
invisible: false
8796
reserved_ip_range:
8897
name: reserved_ip_range
8998
title: Reserved Ip Range
@@ -93,6 +102,12 @@ spec:
93102
tier:
94103
name: tier
95104
title: Tier
105+
invisible: false
106+
enumValueLabels:
107+
- label: STANDARD_HA
108+
value: STANDARD_HA
109+
- label: BASIC
110+
value: BASIC
96111
transit_encryption_mode:
97112
name: transit_encryption_mode
98113
title: Transit Encryption Mode

metadata.yaml

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -52,30 +52,20 @@ spec:
5252
location: examples/valkey
5353
interfaces:
5454
variables:
55-
- name: region
56-
description: The GCP region to use.
57-
varType: string
5855
- name: project_id
5956
description: The ID of the project in which the resource belongs to.
6057
varType: string
6158
required: true
62-
- name: enable_apis
63-
description: Flag for enabling redis.googleapis.com in your project
64-
varType: bool
65-
defaultValue: true
59+
- name: region
60+
description: The GCP region to use.
61+
varType: string
6662
- name: name
6763
description: The ID of the instance or a fully qualified identifier for the instance.
6864
varType: string
6965
required: true
70-
- name: authorized_network
71-
description: The full name of the Google Compute Engine network to which the instance is connected. If left unspecified, the default network will be used.
66+
- name: display_name
67+
description: An arbitrary and optional user-provided name for the instance.
7268
varType: string
73-
connections:
74-
- source:
75-
source: github.com/terraform-google-modules/terraform-google-network//modules/vpc
76-
version: ">= 9.1.0"
77-
spec:
78-
outputExpr: network_name
7969
- name: tier
8070
description: The service tier of the instance. https://cloud.google.com/memorystore/docs/redis/reference/rest/v1/projects.locations.instances#Tier
8171
varType: string
@@ -85,8 +75,27 @@ spec:
8575
varType: number
8676
defaultValue: 1
8777
- name: replica_count
88-
description: The number of replicas. can
78+
description: The number of replicas.
8979
varType: number
80+
- name: authorized_network
81+
description: The full name of the Google Compute Engine network to which the instance is connected. If left unspecified, the default network will be used.
82+
varType: string
83+
connections:
84+
- source:
85+
source: github.com/terraform-google-modules/terraform-google-network//modules/vpc
86+
version: ">= 9.1.0"
87+
spec:
88+
outputExpr: network_name
89+
- name: redis_version
90+
description: The version of Redis software.
91+
varType: string
92+
- name: connect_mode
93+
description: The connection mode of the Redis instance. Can be either DIRECT_PEERING or PRIVATE_SERVICE_ACCESS. The default connect mode if not provided is DIRECT_PEERING.
94+
varType: string
95+
- name: enable_apis
96+
description: Flag for enabling redis.googleapis.com in your project
97+
varType: bool
98+
defaultValue: true
9099
- name: read_replicas_mode
91100
description: "Read replicas mode. https://cloud.google.com/memorystore/docs/redis/reference/rest/v1/projects.locations.instances#readreplicasmode "
92101
varType: string
@@ -97,25 +106,16 @@ spec:
97106
- name: alternative_location_id
98107
description: The alternative zone where the instance will be provisioned.
99108
varType: string
100-
- name: redis_version
101-
description: The version of Redis software.
102-
varType: string
103109
- name: redis_configs
104110
description: The Redis configuration parameters. See [more details](https://cloud.google.com/memorystore/docs/redis/reference/rest/v1/projects.locations.instances#Instance.FIELDS.redis_configs)
105111
varType: map(any)
106112
defaultValue: {}
107-
- name: display_name
108-
description: An arbitrary and optional user-provided name for the instance.
109-
varType: string
110113
- name: reserved_ip_range
111114
description: The CIDR range of internal addresses that are reserved for this instance.
112115
varType: string
113116
- name: secondary_ip_range
114117
description: Optional. Additional IP range for node placement. Required when enabling read replicas on an existing instance.
115118
varType: string
116-
- name: connect_mode
117-
description: The connection mode of the Redis instance. Can be either DIRECT_PEERING or PRIVATE_SERVICE_ACCESS. The default connect mode if not provided is DIRECT_PEERING.
118-
varType: string
119119
- name: labels
120120
description: The resource labels to represent user provided metadata.
121121
varType: map(string)

modules/memcache/metadata.yaml

Lines changed: 38 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -46,24 +46,53 @@ spec:
4646
location: examples/valkey
4747
interfaces:
4848
variables:
49+
- name: region
50+
description: The GCP region to use.
51+
varType: string
52+
required: true
53+
- name: project_id
54+
description: The ID of the project in which the resource belongs to.
55+
varType: string
56+
required: true
57+
- name: enable_apis
58+
description: Flag for enabling memcache.googleapis.com in your project
59+
varType: bool
60+
defaultValue: true
61+
- name: name
62+
description: The ID of the instance or a fully qualified identifier for the instance.
63+
varType: string
64+
required: true
65+
- name: memcache_version
66+
description: The major version of Memcached software.
67+
varType: string
4968
- name: authorized_network
5069
description: The full name of the Google Compute Engine network to which the instance is connected. If left unspecified, the default network will be used.
5170
varType: string
71+
- name: node_count
72+
description: Number of nodes in the memcache instance.
73+
varType: number
74+
defaultValue: 1
5275
- name: cpu_count
5376
description: Number of CPUs per node
5477
varType: number
5578
defaultValue: 1
79+
- name: memory_size_mb
80+
description: Memcache memory size in MiB. Defaulted to 1024
81+
varType: number
82+
defaultValue: 1024
83+
- name: zones
84+
description: Zones where memcache nodes should be provisioned. If not provided, all zones will be used.
85+
varType: list(string)
5686
- name: display_name
5787
description: An arbitrary and optional user-provided name for the instance.
5888
varType: string
59-
- name: enable_apis
60-
description: Flag for enabling memcache.googleapis.com in your project
61-
varType: bool
62-
defaultValue: true
6389
- name: labels
6490
description: The resource labels to represent user provided metadata.
6591
varType: map(string)
6692
defaultValue: {}
93+
- name: params
94+
description: Parameters for the memcache process
95+
varType: map(string)
6796
- name: maintenance_policy
6897
description: The maintenance policy for an instance.
6998
varType: |-
@@ -77,35 +106,6 @@ spec:
77106
nanos = number
78107
})
79108
})
80-
- name: memcache_version
81-
description: The major version of Memcached software.
82-
varType: string
83-
- name: memory_size_mb
84-
description: Memcache memory size in MiB. Defaulted to 1024
85-
varType: number
86-
defaultValue: 1024
87-
- name: name
88-
description: The ID of the instance or a fully qualified identifier for the instance.
89-
varType: string
90-
required: true
91-
- name: node_count
92-
description: Number of nodes in the memcache instance.
93-
varType: number
94-
defaultValue: 1
95-
- name: params
96-
description: Parameters for the memcache process
97-
varType: map(string)
98-
- name: project_id
99-
description: The ID of the project in which the resource belongs to.
100-
varType: string
101-
required: true
102-
- name: region
103-
description: The GCP region to use.
104-
varType: string
105-
required: true
106-
- name: zones
107-
description: Zones where memcache nodes should be provisioned. If not provided, all zones will be used.
108-
varType: list(string)
109109
outputs:
110110
- name: discovery
111111
description: The memorystore discovery endpoint.
@@ -128,3 +128,8 @@ spec:
128128
- serviceconsumermanagement.googleapis.com
129129
- networkconnectivity.googleapis.com
130130
- compute.googleapis.com
131+
providerVersions:
132+
- source: hashicorp/google
133+
version: ">= 4.23.0, < 7"
134+
- source: hashicorp/google-beta
135+
version: ">= 4.23.0, < 7"

modules/redis-cluster/metadata.yaml

Lines changed: 40 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -46,52 +46,42 @@ spec:
4646
location: examples/valkey
4747
interfaces:
4848
variables:
49-
- name: authorization_mode
50-
description: "The authorization mode of the Redis cluster. If not provided, auth feature is disabled for the cluster. Default value is AUTH_MODE_DISABLED. Possible values are: AUTH_MODE_UNSPECIFIED, AUTH_MODE_IAM_AUTH, AUTH_MODE_DISABLED"
51-
varType: string
52-
defaultValue: AUTH_MODE_DISABLED
53-
- name: deletion_protection_enabled
54-
description: " Indicates if the cluster is deletion protected or not. If the value if set to true, any delete cluster operation will fail. Default value is true"
55-
varType: bool
56-
defaultValue: true
57-
- name: enable_apis
58-
description: Flag for enabling memcache.googleapis.com in your project
59-
varType: bool
60-
defaultValue: true
6149
- name: name
6250
description: The ID of the instance or a fully qualified identifier for the instance. must be 1 to 63 characters and use only lowercase letters, numbers, or hyphens. It must start with a lowercase letter and end with a lowercase letter or number
6351
varType: string
6452
required: true
65-
- name: network
66-
description: List of consumer network where the network address of the discovery endpoint will be reserved, in the form of projects/{network_project_id_or_number}/global/networks/{network_id}. Currently, only one item is supported
67-
varType: list(string)
68-
required: true
69-
- name: node_type
70-
description: "The nodeType for the Redis cluster. If not provided, REDIS_HIGHMEM_MEDIUM will be used as default Possible values are: REDIS_SHARED_CORE_NANO, REDIS_HIGHMEM_MEDIUM, REDIS_HIGHMEM_XLARGE, REDIS_STANDARD_SMALL."
71-
varType: string
7253
- name: project_id
7354
description: The ID of the project in which the resource belongs to.
7455
varType: string
7556
required: true
76-
- name: redis_configs
77-
description: Configure Redis Cluster behavior using a subset of native Redis configuration parameters
78-
varType: |-
79-
object({
80-
maxmemory-clients = optional(string)
81-
maxmemory = optional(string)
82-
maxmemory-policy = optional(string)
83-
notify-keyspace-events = optional(string)
84-
slowlog-log-slower-than = optional(number)
85-
maxclients = optional(number)
86-
})
8757
- name: region
8858
description: The name of the region of the Redis cluster
8959
varType: string
9060
required: true
61+
- name: enable_apis
62+
description: Flag for enabling memcache.googleapis.com in your project
63+
varType: bool
64+
defaultValue: true
65+
- name: shard_count
66+
description: Required. Number of shards for the Redis cluster. The minimum number of shards in a Memorystore cluster is 3 shards
67+
varType: number
68+
defaultValue: 3
9169
- name: replica_count
9270
description: The number of replica nodes per shard. Each shard can have 0, 1, or 2 replica nodes. Replicas provide high availability and additional read throughput, and are evenly distributed across zones
9371
varType: number
9472
defaultValue: 0
73+
- name: transit_encryption_mode
74+
description: "The in-transit encryption for the Redis cluster. If not provided, encryption is disabled for the cluster. Default value is TRANSIT_ENCRYPTION_MODE_DISABLED. Possible values are: TRANSIT_ENCRYPTION_MODE_UNSPECIFIED, TRANSIT_ENCRYPTION_MODE_DISABLED, TRANSIT_ENCRYPTION_MODE_SERVER_AUTHENTICATION"
75+
varType: string
76+
defaultValue: TRANSIT_ENCRYPTION_MODE_DISABLED
77+
- name: authorization_mode
78+
description: "The authorization mode of the Redis cluster. If not provided, auth feature is disabled for the cluster. Default value is AUTH_MODE_DISABLED. Possible values are: AUTH_MODE_UNSPECIFIED, AUTH_MODE_IAM_AUTH, AUTH_MODE_DISABLED"
79+
varType: string
80+
defaultValue: AUTH_MODE_DISABLED
81+
- name: network
82+
description: List of consumer network where the network address of the discovery endpoint will be reserved, in the form of projects/{network_project_id_or_number}/global/networks/{network_id}. Currently, only one item is supported
83+
varType: list(string)
84+
required: true
9585
- name: service_connection_policies
9686
description: The Service Connection Policies to create
9787
varType: |-
@@ -104,21 +94,31 @@ spec:
10494
labels = optional(map(string), {})
10595
}))
10696
defaultValue: {}
107-
- name: shard_count
108-
description: Required. Number of shards for the Redis cluster. The minimum number of shards in a Memorystore cluster is 3 shards
109-
varType: number
110-
defaultValue: 3
111-
- name: transit_encryption_mode
112-
description: "The in-transit encryption for the Redis cluster. If not provided, encryption is disabled for the cluster. Default value is TRANSIT_ENCRYPTION_MODE_DISABLED. Possible values are: TRANSIT_ENCRYPTION_MODE_UNSPECIFIED, TRANSIT_ENCRYPTION_MODE_DISABLED, TRANSIT_ENCRYPTION_MODE_SERVER_AUTHENTICATION"
97+
- name: node_type
98+
description: "The nodeType for the Redis cluster. If not provided, REDIS_HIGHMEM_MEDIUM will be used as default Possible values are: REDIS_SHARED_CORE_NANO, REDIS_HIGHMEM_MEDIUM, REDIS_HIGHMEM_XLARGE, REDIS_STANDARD_SMALL."
11399
varType: string
114-
defaultValue: TRANSIT_ENCRYPTION_MODE_DISABLED
100+
- name: redis_configs
101+
description: Configure Redis Cluster behavior using a subset of native Redis configuration parameters
102+
varType: |-
103+
object({
104+
maxmemory-clients = optional(string)
105+
maxmemory = optional(string)
106+
maxmemory-policy = optional(string)
107+
notify-keyspace-events = optional(string)
108+
slowlog-log-slower-than = optional(number)
109+
maxclients = optional(number)
110+
})
115111
- name: zone_distribution_config_mode
116112
description: "The mode for zone distribution for Memorystore Redis cluster (Immutable). If not provided, MULTI_ZONE will be used as default value. Possible values are: MULTI_ZONE, SINGLE_ZONE"
117113
varType: string
118114
defaultValue: MULTI_ZONE
119115
- name: zone_distribution_config_zone
120116
description: The zone for single zone Memorystore Redis cluster (Immutable)
121117
varType: string
118+
- name: deletion_protection_enabled
119+
description: " Indicates if the cluster is deletion protected or not. If the value if set to true, any delete cluster operation will fail. Default value is true"
120+
varType: bool
121+
defaultValue: true
122122
outputs:
123123
- name: discovery_endpoints
124124
description: Endpoints created on each given network, for Redis clients to connect to the cluster. Currently only one endpoint is supported
@@ -141,3 +141,6 @@ spec:
141141
- serviceconsumermanagement.googleapis.com
142142
- networkconnectivity.googleapis.com
143143
- compute.googleapis.com
144+
providerVersions:
145+
- source: hashicorp/google
146+
version: ">= 6.0, < 7"

0 commit comments

Comments
 (0)