generated from hashicorp/terraform-provider-scaffolding
/
option_group_singular_data_source_gen.go
282 lines (269 loc) · 11 KB
/
option_group_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
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
// Code generated by generators/singular-data-source/main.go; DO NOT EDIT.
package rds
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_rds_option_group", optionGroupDataSource)
}
// optionGroupDataSource returns the Terraform awscc_rds_option_group data source.
// This Terraform data source corresponds to the CloudFormation AWS::RDS::OptionGroup resource.
func optionGroupDataSource(ctx context.Context) (datasource.DataSource, error) {
attributes := map[string]schema.Attribute{ /*START SCHEMA*/
// Property: EngineName
// CloudFormation resource type schema:
//
// {
// "description": "Indicates the name of the engine that this option group can be applied to.",
// "type": "string"
// }
"engine_name": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "Indicates the name of the engine that this option group can be applied to.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: MajorEngineVersion
// CloudFormation resource type schema:
//
// {
// "description": "Indicates the major engine version associated with this option group.",
// "type": "string"
// }
"major_engine_version": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "Indicates the major engine version associated with this option group.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: OptionConfigurations
// CloudFormation resource type schema:
//
// {
// "arrayType": "AttributeList",
// "description": "Indicates what options are available in the option group.",
// "insertionOrder": false,
// "items": {
// "additionalProperties": false,
// "description": "The OptionConfiguration property type specifies an individual option, and its settings, within an AWS::RDS::OptionGroup resource.",
// "properties": {
// "DBSecurityGroupMemberships": {
// "description": "A list of DBSecurityGroupMembership name strings used for this option.",
// "insertionOrder": false,
// "items": {
// "type": "string"
// },
// "type": "array",
// "uniqueItems": true
// },
// "OptionName": {
// "description": "The configuration of options to include in a group.",
// "type": "string"
// },
// "OptionSettings": {
// "description": "The option settings to include in an option group.",
// "insertionOrder": false,
// "items": {
// "additionalProperties": false,
// "description": "The OptionSetting property type specifies the value for an option within an OptionSetting property.",
// "properties": {
// "Name": {
// "description": "The name of the option that has settings that you can set.",
// "type": "string"
// },
// "Value": {
// "description": "The current value of the option setting.",
// "type": "string"
// }
// },
// "type": "object"
// },
// "type": "array"
// },
// "OptionVersion": {
// "description": "The version for the option.",
// "type": "string"
// },
// "Port": {
// "description": "The optional port for the option.",
// "type": "integer"
// },
// "VpcSecurityGroupMemberships": {
// "description": "A list of VpcSecurityGroupMembership name strings used for this option.",
// "insertionOrder": false,
// "items": {
// "type": "string"
// },
// "type": "array",
// "uniqueItems": true
// }
// },
// "required": [
// "OptionName"
// ],
// "type": "object"
// },
// "type": "array"
// }
"option_configurations": schema.ListNestedAttribute{ /*START ATTRIBUTE*/
NestedObject: schema.NestedAttributeObject{ /*START NESTED OBJECT*/
Attributes: map[string]schema.Attribute{ /*START SCHEMA*/
// Property: DBSecurityGroupMemberships
"db_security_group_memberships": schema.SetAttribute{ /*START ATTRIBUTE*/
ElementType: types.StringType,
Description: "A list of DBSecurityGroupMembership name strings used for this option.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: OptionName
"option_name": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The configuration of options to include in a group.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: OptionSettings
"option_settings": schema.ListNestedAttribute{ /*START ATTRIBUTE*/
NestedObject: schema.NestedAttributeObject{ /*START NESTED OBJECT*/
Attributes: map[string]schema.Attribute{ /*START SCHEMA*/
// Property: Name
"name": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The name of the option that has settings that you can set.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Value
"value": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The current value of the option setting.",
Computed: true,
}, /*END ATTRIBUTE*/
}, /*END SCHEMA*/
}, /*END NESTED OBJECT*/
Description: "The option settings to include in an option group.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: OptionVersion
"option_version": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The version for the option.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Port
"port": schema.Int64Attribute{ /*START ATTRIBUTE*/
Description: "The optional port for the option.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: VpcSecurityGroupMemberships
"vpc_security_group_memberships": schema.SetAttribute{ /*START ATTRIBUTE*/
ElementType: types.StringType,
Description: "A list of VpcSecurityGroupMembership name strings used for this option.",
Computed: true,
}, /*END ATTRIBUTE*/
}, /*END SCHEMA*/
}, /*END NESTED OBJECT*/
Description: "Indicates what options are available in the option group.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: OptionGroupDescription
// CloudFormation resource type schema:
//
// {
// "description": "Provides a description of the option group.",
// "type": "string"
// }
"option_group_description": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "Provides a description of the option group.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: OptionGroupName
// CloudFormation resource type schema:
//
// {
// "description": "Specifies the name of the option group.",
// "type": "string"
// }
"option_group_name": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "Specifies the name of the option group.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Tags
// CloudFormation resource type schema:
//
// {
// "description": "An array of key-value pairs to apply to this resource.",
// "insertionOrder": false,
// "items": {
// "additionalProperties": false,
// "description": "A key-value pair to associate with a resource.",
// "properties": {
// "Key": {
// "description": "The key name of the tag. You can specify a value that is 1 to 128 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -. ",
// "maxLength": 128,
// "minLength": 1,
// "type": "string"
// },
// "Value": {
// "description": "The value for the tag. You can specify a value that is 0 to 256 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -. ",
// "maxLength": 256,
// "minLength": 0,
// "type": "string"
// }
// },
// "required": [
// "Key"
// ],
// "type": "object"
// },
// "type": "array"
// }
"tags": schema.ListNestedAttribute{ /*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 name of the tag. You can specify a value that is 1 to 128 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -. ",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Value
"value": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The value for the tag. You can specify a value that is 0 to 256 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -. ",
Computed: true,
}, /*END ATTRIBUTE*/
}, /*END SCHEMA*/
}, /*END NESTED OBJECT*/
Description: "An array of key-value pairs to apply to this resource.",
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::RDS::OptionGroup",
Attributes: attributes,
}
var opts generic.DataSourceOptions
opts = opts.WithCloudFormationTypeName("AWS::RDS::OptionGroup").WithTerraformTypeName("awscc_rds_option_group")
opts = opts.WithTerraformSchema(schema)
opts = opts.WithAttributeNameMap(map[string]string{
"db_security_group_memberships": "DBSecurityGroupMemberships",
"engine_name": "EngineName",
"key": "Key",
"major_engine_version": "MajorEngineVersion",
"name": "Name",
"option_configurations": "OptionConfigurations",
"option_group_description": "OptionGroupDescription",
"option_group_name": "OptionGroupName",
"option_name": "OptionName",
"option_settings": "OptionSettings",
"option_version": "OptionVersion",
"port": "Port",
"tags": "Tags",
"value": "Value",
"vpc_security_group_memberships": "VpcSecurityGroupMemberships",
})
v, err := generic.NewSingularDataSource(ctx, opts...)
if err != nil {
return nil, err
}
return v, nil
}