-
Notifications
You must be signed in to change notification settings - Fork 1.8k
/
Copy pathInstance.yaml
565 lines (559 loc) · 22.3 KB
/
Instance.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
# Copyright 2023 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: 'Instance'
base_url: projects/{{project}}/locations/{{region}}/instances
create_url: projects/{{project}}/locations/{{region}}/instances?instanceId={{name}}
update_verb: :PATCH
update_mask: true
description: |
A Google Cloud Redis instance.
references: !ruby/object:Api::Resource::ReferenceLinks
guides:
'Official Documentation': 'https://cloud.google.com/memorystore/docs/redis/'
api: 'https://cloud.google.com/memorystore/docs/redis/reference/rest/v1/projects.locations.instances'
timeouts: !ruby/object:Api::Timeouts
insert_minutes: 20
update_minutes: 20
delete_minutes: 20
autogen_async: true
skip_default_cdiff: true
custom_code: !ruby/object:Provider::Terraform::CustomCode
encoder: templates/terraform/encoders/redis_location_id_for_fallback_zone.go.erb
decoder: templates/terraform/decoders/redis_instance.go.erb
extra_schema_entry: templates/terraform/extra_schema_entry/redis_instance.erb
constants: templates/terraform/constants/redis_instance.go.erb
custom_diff: [
'customdiff.ForceNewIfChange("redis_version", isRedisVersionDecreasing)',
'tpgresource.DefaultProviderProject',
]
examples:
- !ruby/object:Provider::Terraform::Examples
name: 'redis_instance_basic'
primary_resource_id: 'cache'
vars:
instance_name: 'memory-cache'
prevent_destroy: 'true'
test_vars_overrides:
prevent_destroy: 'false'
oics_vars_overrides:
prevent_destroy: 'false'
- !ruby/object:Provider::Terraform::Examples
name: 'redis_instance_full'
primary_resource_id: 'cache'
vars:
instance_name: 'ha-memory-cache'
network_name: 'redis-test-network'
prevent_destroy: 'true'
test_vars_overrides:
network_name: 'acctest.BootstrapSharedTestNetwork(t, "redis-full")'
prevent_destroy: 'false'
oics_vars_overrides:
prevent_destroy: 'false'
- !ruby/object:Provider::Terraform::Examples
name: 'redis_instance_full_with_persistence_config'
primary_resource_id: 'cache-persis'
vars:
instance_name: 'ha-memory-cache-persis'
network_name: 'redis-test-network'
prevent_destroy: 'true'
test_vars_overrides:
network_name: 'acctest.BootstrapSharedTestNetwork(t, "redis-full-persis")'
prevent_destroy: 'false'
oics_vars_overrides:
prevent_destroy: 'false'
- !ruby/object:Provider::Terraform::Examples
name: 'redis_instance_private_service'
primary_resource_id: 'cache'
vars:
instance_name: 'private-cache'
address_name: 'address'
network_name: 'redis-test-network'
prevent_destroy: 'true'
test_vars_overrides:
prevent_destroy: 'false'
oics_vars_overrides:
prevent_destroy: 'false'
skip_test: true
- !ruby/object:Provider::Terraform::Examples
name: 'redis_instance_private_service_test'
primary_resource_id: 'cache'
vars:
instance_name: 'private-cache'
network_name: 'redis-test-network'
prevent_destroy: 'true'
test_vars_overrides:
network_name: 'acctest.BootstrapSharedServiceNetworkingConnection(t, "vpc-network-1")'
prevent_destroy: 'false'
oics_vars_overrides:
prevent_destroy: 'false'
skip_docs: true
- !ruby/object:Provider::Terraform::Examples
name: 'redis_instance_mrr'
primary_resource_id: 'cache'
vars:
instance_name: 'mrr-memory-cache'
network_name: 'redis-test-network'
prevent_destroy: 'true'
test_vars_overrides:
network_name: 'acctest.BootstrapSharedTestNetwork(t, "redis-mrr")'
prevent_destroy: 'false'
oics_vars_overrides:
prevent_destroy: 'false'
- !ruby/object:Provider::Terraform::Examples
name: 'redis_instance_cmek'
primary_resource_id: 'cache'
skip_test: true
vars:
instance_name: 'cmek-memory-cache'
network_name: 'redis-test-network'
prevent_destroy: 'true'
test_vars_overrides:
network_name: 'acctest.BootstrapSharedTestNetwork(t, "redis-cmek")'
prevent_destroy: 'false'
oics_vars_overrides:
prevent_destroy: 'false'
parameters:
# TODO: resourceref?
- !ruby/object:Api::Type::String
name: 'region'
description: |
The name of the Redis region of the instance.
required: false
immutable: true
url_param_only: true
ignore_read: true
default_from_api: true
properties:
- !ruby/object:Api::Type::String
name: alternativeLocationId
description: |
Only applicable to STANDARD_HA tier which protects the instance
against zonal failures by provisioning it across two zones.
If provided, it must be a different zone from the one provided in
[locationId].
immutable: true
default_from_api: true
- !ruby/object:Api::Type::Boolean
name: authEnabled
description: |
Optional. Indicates whether OSS Redis AUTH is enabled for the
instance. If set to "true" AUTH is enabled on the instance.
Default value is "false" meaning AUTH is disabled.
default_value: false
- !ruby/object:Api::Type::String
name: authorizedNetwork
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.
immutable: true
default_from_api: true
custom_expand: 'templates/terraform/custom_expand/redis_instance_authorized_network.erb'
diff_suppress_func: 'tpgresource.CompareSelfLinkOrResourceName'
- !ruby/object:Api::Type::Enum
name: connectMode
description: |
The connection mode of the Redis instance.
immutable: true
values:
- :DIRECT_PEERING
- :PRIVATE_SERVICE_ACCESS
default_value: :DIRECT_PEERING
- !ruby/object:Api::Type::Time
name: createTime
description: |
The time the instance was created in RFC3339 UTC "Zulu" format,
accurate to nanoseconds.
output: true
- !ruby/object:Api::Type::String
name: currentLocationId
description: |
The current zone where the Redis endpoint is placed.
For Basic Tier instances, this will always be the same as the
[locationId] provided by the user at creation time. For Standard Tier
instances, this can be either [locationId] or [alternativeLocationId]
and can change after a failover event.
output: true
- !ruby/object:Api::Type::String
name: displayName
description: |
An arbitrary and optional user-provided name for the instance.
- !ruby/object:Api::Type::String
name: host
description: |
Hostname or IP address of the exposed Redis endpoint used by clients
to connect to the service.
output: true
- !ruby/object:Api::Type::KeyValueLabels
name: 'labels'
description: Resource labels to represent user provided metadata.
- !ruby/object:Api::Type::KeyValuePairs
name: 'redisConfigs'
description: |
Redis configuration parameters, according to http://redis.io/topics/config.
Please check Memorystore documentation for the list of supported parameters:
https://cloud.google.com/memorystore/docs/redis/reference/rest/v1/projects.locations.instances#Instance.FIELDS.redis_configs
- !ruby/object:Api::Type::String
name: locationId
description: |
The zone where the instance will be provisioned. If not provided,
the service will choose a zone for the instance. For STANDARD_HA tier,
instances will be created across two zones for protection against
zonal failures. If [alternativeLocationId] is also provided, it must
be different from [locationId].
immutable: true
default_from_api: true
- !ruby/object:Api::Type::String
name: name
description: |
The ID of the instance or a fully qualified identifier for the instance.
required: true
immutable: true
custom_expand: 'templates/terraform/custom_expand/shortname_to_url.go.erb'
custom_flatten: 'templates/terraform/custom_flatten/name_from_self_link.erb'
validation: !ruby/object:Provider::Terraform::Validation
regex: '^[a-z][a-z0-9-]{0,39}[a-z0-9]$'
- !ruby/object:Api::Type::NestedObject
name: persistenceConfig
description: Persistence configuration for an instance.
default_from_api: true
properties:
- !ruby/object:Api::Type::Enum
name: 'persistenceMode'
required: true
description: |
Optional. Controls whether Persistence features are enabled. If not provided, the existing value will be used.
- DISABLED: Persistence is disabled for the instance, and any existing snapshots are deleted.
- RDB: RDB based Persistence is enabled.
values:
- :DISABLED
- :RDB
default_from_api: true
- !ruby/object:Api::Type::Enum
name: 'rdbSnapshotPeriod'
required: false
description: |
Optional. Available snapshot periods for scheduling.
- ONE_HOUR: Snapshot every 1 hour.
- SIX_HOURS: Snapshot every 6 hours.
- TWELVE_HOURS: Snapshot every 12 hours.
- TWENTY_FOUR_HOURS: Snapshot every 24 hours.
values:
- :ONE_HOUR
- :SIX_HOURS
- :TWELVE_HOURS
- :TWENTY_FOUR_HOURS
- !ruby/object:Api::Type::String
name: 'rdbNextSnapshotTime'
output: true
description: |
Output only. The next time that a snapshot attempt is scheduled to occur.
A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up
to nine fractional digits.
Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".
- !ruby/object:Api::Type::String
name: 'rdbSnapshotStartTime'
description: |
Optional. Date and time that the first snapshot was/will be attempted,
and to which future snapshots will be aligned. If not provided,
the current time will be used.
A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution
and up to nine fractional digits.
Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".
default_from_api: true
- !ruby/object:Api::Type::NestedObject
name: maintenancePolicy
description: Maintenance policy for an instance.
properties:
- !ruby/object:Api::Type::String
name: 'createTime'
output: true
description: |
Output only. The time when the policy was created.
A timestamp in RFC3339 UTC "Zulu" format, with nanosecond
resolution and up to nine fractional digits.
- !ruby/object:Api::Type::String
name: 'updateTime'
output: true
description: |
Output only. The time when the policy was last updated.
A timestamp in RFC3339 UTC "Zulu" format, with nanosecond
resolution and up to nine fractional digits.
- !ruby/object:Api::Type::String
name: 'description'
description: |
Optional. Description of what this policy is for.
Create/Update methods return INVALID_ARGUMENT if the
length is greater than 512.
- !ruby/object:Api::Type::Array
name: 'weeklyMaintenanceWindow'
description: |
Optional. Maintenance window that is applied to resources covered by this policy.
Minimum 1. For the current version, the maximum number
of weekly_window is expected to be one.
item_type: !ruby/object:Api::Type::NestedObject
properties:
- !ruby/object:Api::Type::Enum
name: 'day'
required: true
description: |
Required. The day of week that maintenance updates occur.
- DAY_OF_WEEK_UNSPECIFIED: The day of the week is unspecified.
- MONDAY: Monday
- TUESDAY: Tuesday
- WEDNESDAY: Wednesday
- THURSDAY: Thursday
- FRIDAY: Friday
- SATURDAY: Saturday
- SUNDAY: Sunday
values:
- :DAY_OF_WEEK_UNSPECIFIED
- :MONDAY
- :TUESDAY
- :WEDNESDAY
- :THURSDAY
- :FRIDAY
- :SATURDAY
- :SUNDAY
- !ruby/object:Api::Type::String
name: 'duration'
output: true
description: |
Output only. Duration of the maintenance window.
The current window is fixed at 1 hour.
A duration in seconds with up to nine fractional digits,
terminated by 's'. Example: "3.5s".
- !ruby/object:Api::Type::NestedObject
name: 'startTime'
required: true
allow_empty_object: true
send_empty_value: true
description: |
Required. Start time of the window in UTC time.
properties:
- !ruby/object:Api::Type::Integer
name: 'hours'
description: |
Hours of day in 24 hour format. Should be from 0 to 23.
An API may choose to allow the value "24:00:00" for scenarios like business closing time.
validation: !ruby/object:Provider::Terraform::Validation
function: 'validation.IntBetween(0,23)'
- !ruby/object:Api::Type::Integer
name: 'minutes'
description: |
Minutes of hour of day. Must be from 0 to 59.
validation: !ruby/object:Provider::Terraform::Validation
function: 'validation.IntBetween(0,59)'
- !ruby/object:Api::Type::Integer
name: 'seconds'
description: |
Seconds of minutes of the time. Must normally be from 0 to 59.
An API may allow the value 60 if it allows leap-seconds.
validation: !ruby/object:Provider::Terraform::Validation
function: 'validation.IntBetween(0,60)'
- !ruby/object:Api::Type::Integer
name: 'nanos'
description: |
Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999.
validation: !ruby/object:Provider::Terraform::Validation
function: 'validation.IntBetween(0,999999999)'
- !ruby/object:Api::Type::NestedObject
name: maintenanceSchedule
output: true
description: Upcoming maintenance schedule.
properties:
- !ruby/object:Api::Type::String
name: 'startTime'
output: true
description: |
Output only. The start time of any upcoming scheduled maintenance for this instance.
A timestamp in RFC3339 UTC "Zulu" format, with nanosecond
resolution and up to nine fractional digits.
- !ruby/object:Api::Type::String
name: 'endTime'
output: true
description: |
Output only. The end time of any upcoming scheduled maintenance for this instance.
A timestamp in RFC3339 UTC "Zulu" format, with nanosecond
resolution and up to nine fractional digits.
- !ruby/object:Api::Type::String
name: 'scheduleDeadlineTime'
output: true
description: |
Output only. The deadline that the maintenance schedule start time
can not go beyond, including reschedule.
A timestamp in RFC3339 UTC "Zulu" format, with nanosecond
resolution and up to nine fractional digits.
- !ruby/object:Api::Type::String
name: maintenanceVersion
description: The self service update maintenance version.
required: false
default_from_api: true
- !ruby/object:Api::Type::Integer
name: memorySizeGb
description: Redis memory size in GiB.
required: true
- !ruby/object:Api::Type::Integer
name: port
description: The port number of the exposed Redis endpoint.
output: true
- !ruby/object:Api::Type::String
name: persistenceIamIdentity
description: |
Output only. Cloud IAM identity used by import / export operations
to transfer data to/from Cloud Storage. Format is "serviceAccount:".
The value may change over time for a given instance so should be
checked before each import/export operation.
output: true
- !ruby/object:Api::Type::String
name: redisVersion
description: |
The version of Redis software. If not provided, latest supported
version will be used. Please check the API documentation linked
at the top for the latest valid values.
default_from_api: true
update_url: 'projects/{{project}}/locations/{{region}}/instances/{{name}}:upgrade'
update_verb: :POST
- !ruby/object:Api::Type::String
name: reservedIpRange
description: |
The CIDR range of internal addresses that are reserved for this
instance. If not provided, the service will choose an unused /29
block, for example, 10.0.0.0/29 or 192.168.0.0/29. Ranges must be
unique and non-overlapping with existing subnets in an authorized
network.
immutable: true
# In some situations the returned IP range may not match the sent value
# but will be a subset of the range.
ignore_read: true
default_from_api: true
- !ruby/object:Api::Type::Enum
name: tier
description: |
The service tier of the instance. Must be one of these values:
- BASIC: standalone instance
- STANDARD_HA: highly available primary/replica instances
values:
- :BASIC
- :STANDARD_HA
default_value: :BASIC
immutable: true
- !ruby/object:Api::Type::Enum
name: transitEncryptionMode
immutable: true
description: |
The TLS mode of the Redis instance, If not provided, TLS is disabled for the instance.
- SERVER_AUTHENTICATION: Client to Server traffic encryption enabled with server authentication
values:
- :SERVER_AUTHENTICATION
- :DISABLED
default_value: :DISABLED
- !ruby/object:Api::Type::Array
name: 'serverCaCerts'
description: |
List of server CA certificates for the instance.
output: true
item_type: !ruby/object:Api::Type::NestedObject
properties:
- !ruby/object:Api::Type::String
name: 'serialNumber'
output: true
description: |
Serial number, as extracted from the certificate.
- !ruby/object:Api::Type::String
name: 'cert'
output: true
description: |
The certificate data in PEM format.
- !ruby/object:Api::Type::String
name: 'createTime'
output: true
description: |
The time when the certificate was created.
- !ruby/object:Api::Type::String
name: 'expireTime'
output: true
description: |
The time when the certificate expires.
- !ruby/object:Api::Type::String
name: 'sha1Fingerprint'
output: true
description: |
Sha1 Fingerprint of the certificate.
- !ruby/object:Api::Type::Integer
name: replicaCount
description: |
Optional. The number of replica nodes. The valid range for the Standard Tier with
read replicas enabled is [1-5] and defaults to 2. If read replicas are not enabled
for a Standard Tier instance, the only valid value is 1 and the default is 1.
The valid value for basic tier is 0 and the default is also 0.
default_from_api: true
- !ruby/object:Api::Type::Array
name: nodes
description: |
Output only. Info per node.
output: true
item_type: !ruby/object:Api::Type::NestedObject
properties:
- !ruby/object:Api::Type::String
name: 'id'
output: true
description: |
Node identifying string. e.g. 'node-0', 'node-1'
- !ruby/object:Api::Type::String
name: 'zone'
output: true
description: |
Location of the node.
- !ruby/object:Api::Type::String
name: readEndpoint
description: |
Output only. Hostname or IP address of the exposed readonly Redis endpoint. Standard tier only.
Targets all healthy replica nodes in instance. Replication is asynchronous and replica nodes
will exhibit some lag behind the primary. Write requests must target 'host'.
output: true
- !ruby/object:Api::Type::Integer
name: readEndpointPort
description: |
Output only. The port number of the exposed readonly redis endpoint. Standard tier only.
Write requests should target 'port'.
output: true
- !ruby/object:Api::Type::Enum
name: readReplicasMode
description: |
Optional. Read replica mode. Can only be specified when trying to create the instance.
If not set, Memorystore Redis backend will default to READ_REPLICAS_DISABLED.
- READ_REPLICAS_DISABLED: If disabled, read endpoint will not be provided and the
instance cannot scale up or down the number of replicas.
- READ_REPLICAS_ENABLED: If enabled, read endpoint will be provided and the instance
can scale up and down the number of replicas.
values:
- :READ_REPLICAS_DISABLED
- :READ_REPLICAS_ENABLED
default_from_api: true
- !ruby/object:Api::Type::String
name: secondaryIpRange
description: |
Optional. Additional IP range for node placement. Required when enabling read replicas on
an existing instance. For DIRECT_PEERING mode value must be a CIDR range of size /28, or
"auto". For PRIVATE_SERVICE_ACCESS mode value must be the name of an allocated address
range associated with the private service access connection, or "auto".
default_from_api: true
diff_suppress_func: 'secondaryIpDiffSuppress'
- !ruby/object:Api::Type::String
name: customerManagedKey
immutable: true
description: |
Optional. The KMS key reference that you want to use to encrypt the data at rest for this Redis
instance. If this is provided, CMEK is enabled.