generated from hashicorp/terraform-provider-scaffolding
-
Notifications
You must be signed in to change notification settings - Fork 105
/
simple_ad_resource_gen.go
287 lines (272 loc) · 9.99 KB
/
simple_ad_resource_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
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
// Code generated by generators/resource/main.go; DO NOT EDIT.
package directoryservice
import (
"context"
"github.com/hashicorp/terraform-plugin-framework/resource"
"github.com/hashicorp/terraform-plugin-framework/resource/schema"
"github.com/hashicorp/terraform-plugin-framework/resource/schema/boolplanmodifier"
"github.com/hashicorp/terraform-plugin-framework/resource/schema/listplanmodifier"
"github.com/hashicorp/terraform-plugin-framework/resource/schema/objectplanmodifier"
"github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier"
"github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier"
"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.AddResourceFactory("awscc_directoryservice_simple_ad", simpleADResource)
}
// simpleADResource returns the Terraform awscc_directoryservice_simple_ad resource.
// This Terraform resource corresponds to the CloudFormation AWS::DirectoryService::SimpleAD resource.
func simpleADResource(ctx context.Context) (resource.Resource, error) {
attributes := map[string]schema.Attribute{ /*START SCHEMA*/
// Property: Alias
// CloudFormation resource type schema:
//
// {
// "description": "The alias for a directory.",
// "type": "string"
// }
"alias": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The alias for a directory.",
Computed: true,
PlanModifiers: []planmodifier.String{ /*START PLAN MODIFIERS*/
stringplanmodifier.UseStateForUnknown(),
}, /*END PLAN MODIFIERS*/
}, /*END ATTRIBUTE*/
// Property: CreateAlias
// CloudFormation resource type schema:
//
// {
// "description": "The name of the configuration set.",
// "type": "boolean"
// }
"create_alias": schema.BoolAttribute{ /*START ATTRIBUTE*/
Description: "The name of the configuration set.",
Optional: true,
Computed: true,
PlanModifiers: []planmodifier.Bool{ /*START PLAN MODIFIERS*/
boolplanmodifier.UseStateForUnknown(),
boolplanmodifier.RequiresReplace(),
}, /*END PLAN MODIFIERS*/
}, /*END ATTRIBUTE*/
// Property: Description
// CloudFormation resource type schema:
//
// {
// "description": "Description for the directory.",
// "type": "string"
// }
"description": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "Description for the directory.",
Optional: true,
Computed: true,
PlanModifiers: []planmodifier.String{ /*START PLAN MODIFIERS*/
stringplanmodifier.UseStateForUnknown(),
stringplanmodifier.RequiresReplace(),
}, /*END PLAN MODIFIERS*/
}, /*END ATTRIBUTE*/
// Property: DirectoryId
// CloudFormation resource type schema:
//
// {
// "description": "The unique identifier for a directory.",
// "type": "string"
// }
"directory_id": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The unique identifier for a directory.",
Computed: true,
PlanModifiers: []planmodifier.String{ /*START PLAN MODIFIERS*/
stringplanmodifier.UseStateForUnknown(),
}, /*END PLAN MODIFIERS*/
}, /*END ATTRIBUTE*/
// Property: DnsIpAddresses
// CloudFormation resource type schema:
//
// {
// "description": "The IP addresses of the DNS servers for the directory, such as [ \"172.31.3.154\", \"172.31.63.203\" ].",
// "insertionOrder": false,
// "items": {
// "type": "string"
// },
// "type": "array",
// "uniqueItems": false
// }
"dns_ip_addresses": schema.ListAttribute{ /*START ATTRIBUTE*/
ElementType: types.StringType,
Description: "The IP addresses of the DNS servers for the directory, such as [ \"172.31.3.154\", \"172.31.63.203\" ].",
Computed: true,
PlanModifiers: []planmodifier.List{ /*START PLAN MODIFIERS*/
generic.Multiset(),
listplanmodifier.UseStateForUnknown(),
}, /*END PLAN MODIFIERS*/
}, /*END ATTRIBUTE*/
// Property: EnableSso
// CloudFormation resource type schema:
//
// {
// "description": "Whether to enable single sign-on for a Simple Active Directory in AWS.",
// "type": "boolean"
// }
"enable_sso": schema.BoolAttribute{ /*START ATTRIBUTE*/
Description: "Whether to enable single sign-on for a Simple Active Directory in AWS.",
Optional: true,
Computed: true,
PlanModifiers: []planmodifier.Bool{ /*START PLAN MODIFIERS*/
boolplanmodifier.UseStateForUnknown(),
}, /*END PLAN MODIFIERS*/
}, /*END ATTRIBUTE*/
// Property: Name
// CloudFormation resource type schema:
//
// {
// "description": "The fully qualified domain name for the AWS Managed Simple AD directory.",
// "type": "string"
// }
"name": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The fully qualified domain name for the AWS Managed Simple AD directory.",
Required: true,
PlanModifiers: []planmodifier.String{ /*START PLAN MODIFIERS*/
stringplanmodifier.RequiresReplace(),
}, /*END PLAN MODIFIERS*/
}, /*END ATTRIBUTE*/
// Property: Password
// CloudFormation resource type schema:
//
// {
// "description": "The password for the default administrative user named Admin.",
// "type": "string"
// }
"password": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The password for the default administrative user named Admin.",
Optional: true,
Computed: true,
PlanModifiers: []planmodifier.String{ /*START PLAN MODIFIERS*/
stringplanmodifier.UseStateForUnknown(),
stringplanmodifier.RequiresReplace(),
}, /*END PLAN MODIFIERS*/
// Password is a write-only property.
}, /*END ATTRIBUTE*/
// Property: ShortName
// CloudFormation resource type schema:
//
// {
// "description": "The NetBIOS name for your domain.",
// "type": "string"
// }
"short_name": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The NetBIOS name for your domain.",
Optional: true,
Computed: true,
PlanModifiers: []planmodifier.String{ /*START PLAN MODIFIERS*/
stringplanmodifier.UseStateForUnknown(),
stringplanmodifier.RequiresReplace(),
}, /*END PLAN MODIFIERS*/
}, /*END ATTRIBUTE*/
// Property: Size
// CloudFormation resource type schema:
//
// {
// "description": "The size of the directory.",
// "type": "string"
// }
"size": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The size of the directory.",
Required: true,
PlanModifiers: []planmodifier.String{ /*START PLAN MODIFIERS*/
stringplanmodifier.RequiresReplace(),
}, /*END PLAN MODIFIERS*/
}, /*END ATTRIBUTE*/
// Property: VpcSettings
// CloudFormation resource type schema:
//
// {
// "additionalProperties": false,
// "$comment": "Contains VPC information",
// "description": "VPC settings of the Simple AD directory server in AWS.",
// "properties": {
// "SubnetIds": {
// "description": "The identifiers of the subnets for the directory servers. The two subnets must be in different Availability Zones. AWS Directory Service specifies a directory server and a DNS server in each of these subnets.",
// "insertionOrder": false,
// "items": {
// "type": "string"
// },
// "type": "array",
// "uniqueItems": true
// },
// "VpcId": {
// "description": "The identifier of the VPC in which to create the directory.",
// "type": "string"
// }
// },
// "required": [
// "VpcId",
// "SubnetIds"
// ],
// "type": "object"
// }
"vpc_settings": schema.SingleNestedAttribute{ /*START ATTRIBUTE*/
Attributes: map[string]schema.Attribute{ /*START SCHEMA*/
// Property: SubnetIds
"subnet_ids": schema.SetAttribute{ /*START ATTRIBUTE*/
ElementType: types.StringType,
Description: "The identifiers of the subnets for the directory servers. The two subnets must be in different Availability Zones. AWS Directory Service specifies a directory server and a DNS server in each of these subnets.",
Required: true,
}, /*END ATTRIBUTE*/
// Property: VpcId
"vpc_id": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The identifier of the VPC in which to create the directory.",
Required: true,
}, /*END ATTRIBUTE*/
}, /*END SCHEMA*/
Description: "VPC settings of the Simple AD directory server in AWS.",
Required: true,
PlanModifiers: []planmodifier.Object{ /*START PLAN MODIFIERS*/
objectplanmodifier.RequiresReplace(),
}, /*END PLAN MODIFIERS*/
}, /*END ATTRIBUTE*/
} /*END SCHEMA*/
// Corresponds to CloudFormation primaryIdentifier.
attributes["id"] = schema.StringAttribute{
Description: "Uniquely identifies the resource.",
Computed: true,
PlanModifiers: []planmodifier.String{
stringplanmodifier.UseStateForUnknown(),
},
}
schema := schema.Schema{
Description: "Resource Type definition for AWS::DirectoryService::SimpleAD",
Version: 1,
Attributes: attributes,
}
var opts generic.ResourceOptions
opts = opts.WithCloudFormationTypeName("AWS::DirectoryService::SimpleAD").WithTerraformTypeName("awscc_directoryservice_simple_ad")
opts = opts.WithTerraformSchema(schema)
opts = opts.WithAttributeNameMap(map[string]string{
"alias": "Alias",
"create_alias": "CreateAlias",
"description": "Description",
"directory_id": "DirectoryId",
"dns_ip_addresses": "DnsIpAddresses",
"enable_sso": "EnableSso",
"name": "Name",
"password": "Password",
"short_name": "ShortName",
"size": "Size",
"subnet_ids": "SubnetIds",
"vpc_id": "VpcId",
"vpc_settings": "VpcSettings",
})
opts = opts.WithWriteOnlyPropertyPaths([]string{
"/properties/Password",
})
opts = opts.WithCreateTimeoutInMinutes(60).WithDeleteTimeoutInMinutes(100)
opts = opts.WithUpdateTimeoutInMinutes(0)
v, err := generic.NewResource(ctx, opts...)
if err != nil {
return nil, err
}
return v, nil
}