generated from hashicorp/terraform-provider-scaffolding
/
cluster_singular_data_source_gen.go
474 lines (461 loc) · 18.6 KB
/
cluster_singular_data_source_gen.go
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
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
// Code generated by generators/singular-data-source/main.go; DO NOT EDIT.
package memorydb
import (
"context"
"github.com/hashicorp/terraform-plugin-framework/datasource"
"github.com/hashicorp/terraform-plugin-framework/datasource/schema"
"github.com/hashicorp/terraform-plugin-framework/types"
"github.com/hashicorp/terraform-provider-awscc/internal/generic"
"github.com/hashicorp/terraform-provider-awscc/internal/registry"
)
func init() {
registry.AddDataSourceFactory("awscc_memorydb_cluster", clusterDataSource)
}
// clusterDataSource returns the Terraform awscc_memorydb_cluster data source.
// This Terraform data source corresponds to the CloudFormation AWS::MemoryDB::Cluster resource.
func clusterDataSource(ctx context.Context) (datasource.DataSource, error) {
attributes := map[string]schema.Attribute{ /*START SCHEMA*/
// Property: ACLName
// CloudFormation resource type schema:
//
// {
// "description": "The name of the Access Control List to associate with the cluster.",
// "pattern": "[a-zA-Z][a-zA-Z0-9\\-]*",
// "type": "string"
// }
"acl_name": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The name of the Access Control List to associate with the cluster.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: ARN
// CloudFormation resource type schema:
//
// {
// "description": "The Amazon Resource Name (ARN) of the cluster.",
// "type": "string"
// }
"arn": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The Amazon Resource Name (ARN) of the cluster.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: AutoMinorVersionUpgrade
// CloudFormation resource type schema:
//
// {
// "description": "A flag that enables automatic minor version upgrade when set to true.\n\nYou cannot modify the value of AutoMinorVersionUpgrade after the cluster is created. To enable AutoMinorVersionUpgrade on a cluster you must set AutoMinorVersionUpgrade to true when you create a cluster.",
// "type": "boolean"
// }
"auto_minor_version_upgrade": schema.BoolAttribute{ /*START ATTRIBUTE*/
Description: "A flag that enables automatic minor version upgrade when set to true.\n\nYou cannot modify the value of AutoMinorVersionUpgrade after the cluster is created. To enable AutoMinorVersionUpgrade on a cluster you must set AutoMinorVersionUpgrade to true when you create a cluster.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: ClusterEndpoint
// CloudFormation resource type schema:
//
// {
// "additionalProperties": false,
// "description": "The cluster endpoint.",
// "properties": {
// "Address": {
// "description": "The DNS address of the primary read-write node.",
// "type": "string"
// },
// "Port": {
// "description": "The port number that the engine is listening on. ",
// "type": "integer"
// }
// },
// "type": "object"
// }
"cluster_endpoint": schema.SingleNestedAttribute{ /*START ATTRIBUTE*/
Attributes: map[string]schema.Attribute{ /*START SCHEMA*/
// Property: Address
"address": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The DNS address of the primary read-write node.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Port
"port": schema.Int64Attribute{ /*START ATTRIBUTE*/
Description: "The port number that the engine is listening on. ",
Computed: true,
}, /*END ATTRIBUTE*/
}, /*END SCHEMA*/
Description: "The cluster endpoint.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: ClusterName
// CloudFormation resource type schema:
//
// {
// "description": "The name of the cluster. This value must be unique as it also serves as the cluster identifier.",
// "pattern": "[a-z][a-z0-9\\-]*",
// "type": "string"
// }
"cluster_name": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The name of the cluster. This value must be unique as it also serves as the cluster identifier.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: DataTiering
// CloudFormation resource type schema:
//
// {
// "description": "Enables data tiering. Data tiering is only supported for clusters using the r6gd node type. This parameter must be set when using r6gd nodes.",
// "enum": [
// "true",
// "false"
// ],
// "type": "string"
// }
"data_tiering": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "Enables data tiering. Data tiering is only supported for clusters using the r6gd node type. This parameter must be set when using r6gd nodes.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Description
// CloudFormation resource type schema:
//
// {
// "description": "An optional description of the cluster.",
// "type": "string"
// }
"description": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "An optional description of the cluster.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: EngineVersion
// CloudFormation resource type schema:
//
// {
// "description": "The Redis engine version used by the cluster.",
// "type": "string"
// }
"engine_version": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The Redis engine version used by the cluster.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: FinalSnapshotName
// CloudFormation resource type schema:
//
// {
// "description": "The user-supplied name of a final cluster snapshot. This is the unique name that identifies the snapshot. MemoryDB creates the snapshot, and then deletes the cluster immediately afterward.",
// "type": "string"
// }
"final_snapshot_name": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The user-supplied name of a final cluster snapshot. This is the unique name that identifies the snapshot. MemoryDB creates the snapshot, and then deletes the cluster immediately afterward.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: KmsKeyId
// CloudFormation resource type schema:
//
// {
// "description": "The ID of the KMS key used to encrypt the cluster.",
// "type": "string"
// }
"kms_key_id": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The ID of the KMS key used to encrypt the cluster.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: MaintenanceWindow
// CloudFormation resource type schema:
//
// {
// "description": "Specifies the weekly time range during which maintenance on the cluster is performed. It is specified as a range in the format ddd:hh24:mi-ddd:hh24:mi (24H Clock UTC). The minimum maintenance window is a 60 minute period.",
// "type": "string"
// }
"maintenance_window": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "Specifies the weekly time range during which maintenance on the cluster is performed. It is specified as a range in the format ddd:hh24:mi-ddd:hh24:mi (24H Clock UTC). The minimum maintenance window is a 60 minute period.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: NodeType
// CloudFormation resource type schema:
//
// {
// "description": "The compute and memory capacity of the nodes in the cluster.",
// "type": "string"
// }
"node_type": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The compute and memory capacity of the nodes in the cluster.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: NumReplicasPerShard
// CloudFormation resource type schema:
//
// {
// "description": "The number of replicas to apply to each shard. The limit is 5.",
// "type": "integer"
// }
"num_replicas_per_shard": schema.Int64Attribute{ /*START ATTRIBUTE*/
Description: "The number of replicas to apply to each shard. The limit is 5.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: NumShards
// CloudFormation resource type schema:
//
// {
// "description": "The number of shards the cluster will contain.",
// "type": "integer"
// }
"num_shards": schema.Int64Attribute{ /*START ATTRIBUTE*/
Description: "The number of shards the cluster will contain.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: ParameterGroupName
// CloudFormation resource type schema:
//
// {
// "description": "The name of the parameter group associated with the cluster.",
// "type": "string"
// }
"parameter_group_name": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The name of the parameter group associated with the cluster.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: ParameterGroupStatus
// CloudFormation resource type schema:
//
// {
// "description": "The status of the parameter group used by the cluster.",
// "type": "string"
// }
"parameter_group_status": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The status of the parameter group used by the cluster.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Port
// CloudFormation resource type schema:
//
// {
// "description": "The port number on which each member of the cluster accepts connections.",
// "type": "integer"
// }
"port": schema.Int64Attribute{ /*START ATTRIBUTE*/
Description: "The port number on which each member of the cluster accepts connections.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: SecurityGroupIds
// CloudFormation resource type schema:
//
// {
// "description": "One or more Amazon VPC security groups associated with this cluster.",
// "insertionOrder": false,
// "items": {
// "type": "string"
// },
// "type": "array",
// "uniqueItems": false
// }
"security_group_ids": schema.ListAttribute{ /*START ATTRIBUTE*/
ElementType: types.StringType,
Description: "One or more Amazon VPC security groups associated with this cluster.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: SnapshotArns
// CloudFormation resource type schema:
//
// {
// "description": "A list of Amazon Resource Names (ARN) that uniquely identify the RDB snapshot files stored in Amazon S3. The snapshot files are used to populate the new cluster. The Amazon S3 object name in the ARN cannot contain any commas.",
// "insertionOrder": false,
// "items": {
// "type": "string"
// },
// "type": "array",
// "uniqueItems": false
// }
"snapshot_arns": schema.ListAttribute{ /*START ATTRIBUTE*/
ElementType: types.StringType,
Description: "A list of Amazon Resource Names (ARN) that uniquely identify the RDB snapshot files stored in Amazon S3. The snapshot files are used to populate the new cluster. The Amazon S3 object name in the ARN cannot contain any commas.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: SnapshotName
// CloudFormation resource type schema:
//
// {
// "description": "The name of a snapshot from which to restore data into the new cluster. The snapshot status changes to restoring while the new cluster is being created.",
// "type": "string"
// }
"snapshot_name": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The name of a snapshot from which to restore data into the new cluster. The snapshot status changes to restoring while the new cluster is being created.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: SnapshotRetentionLimit
// CloudFormation resource type schema:
//
// {
// "description": "The number of days for which MemoryDB retains automatic snapshots before deleting them. For example, if you set SnapshotRetentionLimit to 5, a snapshot that was taken today is retained for 5 days before being deleted.",
// "type": "integer"
// }
"snapshot_retention_limit": schema.Int64Attribute{ /*START ATTRIBUTE*/
Description: "The number of days for which MemoryDB retains automatic snapshots before deleting them. For example, if you set SnapshotRetentionLimit to 5, a snapshot that was taken today is retained for 5 days before being deleted.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: SnapshotWindow
// CloudFormation resource type schema:
//
// {
// "description": "The daily time range (in UTC) during which MemoryDB begins taking a daily snapshot of your cluster.",
// "type": "string"
// }
"snapshot_window": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The daily time range (in UTC) during which MemoryDB begins taking a daily snapshot of your cluster.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: SnsTopicArn
// CloudFormation resource type schema:
//
// {
// "description": "The Amazon Resource Name (ARN) of the Amazon Simple Notification Service (SNS) topic to which notifications are sent.",
// "type": "string"
// }
"sns_topic_arn": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The Amazon Resource Name (ARN) of the Amazon Simple Notification Service (SNS) topic to which notifications are sent.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: SnsTopicStatus
// CloudFormation resource type schema:
//
// {
// "description": "The status of the Amazon SNS notification topic. Notifications are sent only if the status is enabled.",
// "type": "string"
// }
"sns_topic_status": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The status of the Amazon SNS notification topic. Notifications are sent only if the status is enabled.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Status
// CloudFormation resource type schema:
//
// {
// "description": "The status of the cluster. For example, Available, Updating, Creating.",
// "type": "string"
// }
"status": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The status of the cluster. For example, Available, Updating, Creating.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: SubnetGroupName
// CloudFormation resource type schema:
//
// {
// "description": "The name of the subnet group to be used for the cluster.",
// "type": "string"
// }
"subnet_group_name": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The name of the subnet group to be used for the cluster.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: TLSEnabled
// CloudFormation resource type schema:
//
// {
// "description": "A flag that enables in-transit encryption when set to true.\n\nYou cannot modify the value of TransitEncryptionEnabled after the cluster is created. To enable in-transit encryption on a cluster you must set TransitEncryptionEnabled to true when you create a cluster.",
// "type": "boolean"
// }
"tls_enabled": schema.BoolAttribute{ /*START ATTRIBUTE*/
Description: "A flag that enables in-transit encryption when set to true.\n\nYou cannot modify the value of TransitEncryptionEnabled after the cluster is created. To enable in-transit encryption on a cluster you must set TransitEncryptionEnabled to true when you create a cluster.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Tags
// CloudFormation resource type schema:
//
// {
// "description": "An array of key-value pairs to apply to this cluster.",
// "insertionOrder": false,
// "items": {
// "additionalProperties": false,
// "description": "A key-value pair to associate with a resource.",
// "properties": {
// "Key": {
// "description": "The key for the tag. May not be null.",
// "maxLength": 128,
// "minLength": 1,
// "pattern": "",
// "type": "string"
// },
// "Value": {
// "description": "The tag's value. May be null.",
// "maxLength": 256,
// "minLength": 1,
// "pattern": "",
// "type": "string"
// }
// },
// "required": [
// "Key",
// "Value"
// ],
// "type": "object"
// },
// "maxItems": 50,
// "type": "array",
// "uniqueItems": true
// }
"tags": schema.SetNestedAttribute{ /*START ATTRIBUTE*/
NestedObject: schema.NestedAttributeObject{ /*START NESTED OBJECT*/
Attributes: map[string]schema.Attribute{ /*START SCHEMA*/
// Property: Key
"key": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The key for the tag. May not be null.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Value
"value": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The tag's value. May be null.",
Computed: true,
}, /*END ATTRIBUTE*/
}, /*END SCHEMA*/
}, /*END NESTED OBJECT*/
Description: "An array of key-value pairs to apply to this cluster.",
Computed: true,
}, /*END ATTRIBUTE*/
} /*END SCHEMA*/
attributes["id"] = schema.StringAttribute{
Description: "Uniquely identifies the resource.",
Required: true,
}
schema := schema.Schema{
Description: "Data Source schema for AWS::MemoryDB::Cluster",
Attributes: attributes,
}
var opts generic.DataSourceOptions
opts = opts.WithCloudFormationTypeName("AWS::MemoryDB::Cluster").WithTerraformTypeName("awscc_memorydb_cluster")
opts = opts.WithTerraformSchema(schema)
opts = opts.WithAttributeNameMap(map[string]string{
"acl_name": "ACLName",
"address": "Address",
"arn": "ARN",
"auto_minor_version_upgrade": "AutoMinorVersionUpgrade",
"cluster_endpoint": "ClusterEndpoint",
"cluster_name": "ClusterName",
"data_tiering": "DataTiering",
"description": "Description",
"engine_version": "EngineVersion",
"final_snapshot_name": "FinalSnapshotName",
"key": "Key",
"kms_key_id": "KmsKeyId",
"maintenance_window": "MaintenanceWindow",
"node_type": "NodeType",
"num_replicas_per_shard": "NumReplicasPerShard",
"num_shards": "NumShards",
"parameter_group_name": "ParameterGroupName",
"parameter_group_status": "ParameterGroupStatus",
"port": "Port",
"security_group_ids": "SecurityGroupIds",
"snapshot_arns": "SnapshotArns",
"snapshot_name": "SnapshotName",
"snapshot_retention_limit": "SnapshotRetentionLimit",
"snapshot_window": "SnapshotWindow",
"sns_topic_arn": "SnsTopicArn",
"sns_topic_status": "SnsTopicStatus",
"status": "Status",
"subnet_group_name": "SubnetGroupName",
"tags": "Tags",
"tls_enabled": "TLSEnabled",
"value": "Value",
})
v, err := generic.NewSingularDataSource(ctx, opts...)
if err != nil {
return nil, err
}
return v, nil
}