generated from hashicorp/terraform-provider-scaffolding
/
assessment_singular_data_source_gen.go
602 lines (589 loc) · 21.7 KB
/
assessment_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
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
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
// Code generated by generators/singular-data-source/main.go; DO NOT EDIT.
package auditmanager
import (
"context"
"github.com/hashicorp/terraform-plugin-framework/datasource"
"github.com/hashicorp/terraform-plugin-framework/datasource/schema"
"github.com/hashicorp/terraform-provider-awscc/internal/generic"
"github.com/hashicorp/terraform-provider-awscc/internal/registry"
)
func init() {
registry.AddDataSourceFactory("awscc_auditmanager_assessment", assessmentDataSource)
}
// assessmentDataSource returns the Terraform awscc_auditmanager_assessment data source.
// This Terraform data source corresponds to the CloudFormation AWS::AuditManager::Assessment resource.
func assessmentDataSource(ctx context.Context) (datasource.DataSource, error) {
attributes := map[string]schema.Attribute{ /*START SCHEMA*/
// Property: Arn
// CloudFormation resource type schema:
//
// {
// "description": "The Amazon Resource Name (ARN) of the assessment.",
// "maxLength": 2048,
// "minLength": 20,
// "pattern": "^arn:.*:auditmanager:.*",
// "type": "string"
// }
"arn": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The Amazon Resource Name (ARN) of the assessment.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: AssessmentId
// CloudFormation resource type schema:
//
// {
// "maxLength": 36,
// "minLength": 36,
// "pattern": "^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$",
// "type": "string"
// }
"assessment_id": schema.StringAttribute{ /*START ATTRIBUTE*/
Computed: true,
}, /*END ATTRIBUTE*/
// Property: AssessmentReportsDestination
// CloudFormation resource type schema:
//
// {
// "additionalProperties": false,
// "description": "The destination in which evidence reports are stored for the specified assessment.",
// "properties": {
// "Destination": {
// "description": "The URL of the specified Amazon S3 bucket.",
// "type": "string"
// },
// "DestinationType": {
// "description": "The destination type, such as Amazon S3.",
// "enum": [
// "S3"
// ],
// "type": "string"
// }
// },
// "type": "object"
// }
"assessment_reports_destination": schema.SingleNestedAttribute{ /*START ATTRIBUTE*/
Attributes: map[string]schema.Attribute{ /*START SCHEMA*/
// Property: Destination
"destination": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The URL of the specified Amazon S3 bucket.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: DestinationType
"destination_type": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The destination type, such as Amazon S3.",
Computed: true,
}, /*END ATTRIBUTE*/
}, /*END SCHEMA*/
Description: "The destination in which evidence reports are stored for the specified assessment.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: AwsAccount
// CloudFormation resource type schema:
//
// {
// "additionalProperties": false,
// "description": "The AWS account associated with the assessment.",
// "properties": {
// "EmailAddress": {
// "description": "The unique identifier for the email account.",
// "maxLength": 320,
// "minLength": 1,
// "pattern": "^.*@.*$",
// "type": "string"
// },
// "Id": {
// "description": "The identifier for the specified AWS account.",
// "maxLength": 12,
// "minLength": 12,
// "pattern": "^[0-9]{12}$",
// "type": "string"
// },
// "Name": {
// "description": "The name of the specified AWS account.",
// "maxLength": 50,
// "minLength": 1,
// "pattern": "",
// "type": "string"
// }
// },
// "type": "object"
// }
"aws_account": schema.SingleNestedAttribute{ /*START ATTRIBUTE*/
Attributes: map[string]schema.Attribute{ /*START SCHEMA*/
// Property: EmailAddress
"email_address": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The unique identifier for the email account.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Id
"id": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The identifier for the specified AWS account.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Name
"name": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The name of the specified AWS account.",
Computed: true,
}, /*END ATTRIBUTE*/
}, /*END SCHEMA*/
Description: "The AWS account associated with the assessment.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: CreationTime
// CloudFormation resource type schema:
//
// {
// "description": "The sequence of characters that identifies when the event occurred.",
// "type": "number"
// }
"creation_time": schema.Float64Attribute{ /*START ATTRIBUTE*/
Description: "The sequence of characters that identifies when the event occurred.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Delegations
// CloudFormation resource type schema:
//
// {
// "description": "The list of delegations.",
// "items": {
// "additionalProperties": false,
// "description": "The assignment of a control set to a delegate for review.",
// "properties": {
// "AssessmentId": {
// "maxLength": 36,
// "minLength": 36,
// "pattern": "^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$",
// "type": "string"
// },
// "AssessmentName": {
// "description": "The name of the related assessment.",
// "maxLength": 127,
// "minLength": 1,
// "pattern": "^[a-zA-Z0-9-_\\.]+$",
// "type": "string"
// },
// "Comment": {
// "description": "The comment related to the delegation.",
// "maxLength": 350,
// "pattern": "^[\\w\\W\\s\\S]*$",
// "type": "string"
// },
// "ControlSetId": {
// "description": "The identifier for the specified control set.",
// "maxLength": 300,
// "minLength": 1,
// "pattern": "^[\\w\\W\\s\\S]*$",
// "type": "string"
// },
// "CreatedBy": {
// "description": "The IAM user or role that performed the action.",
// "maxLength": 2048,
// "minLength": 20,
// "pattern": "^arn:.*:*:.*",
// "type": "string"
// },
// "CreationTime": {
// "description": "The sequence of characters that identifies when the event occurred.",
// "type": "number"
// },
// "Id": {
// "maxLength": 36,
// "minLength": 36,
// "pattern": "^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$",
// "type": "string"
// },
// "LastUpdated": {
// "description": "The sequence of characters that identifies when the event occurred.",
// "type": "number"
// },
// "RoleArn": {
// "description": "The Amazon Resource Name (ARN) of the IAM user or role.",
// "maxLength": 2048,
// "minLength": 20,
// "pattern": "^arn:.*:iam:.*",
// "type": "string"
// },
// "RoleType": {
// "description": " The IAM role type.",
// "enum": [
// "PROCESS_OWNER",
// "RESOURCE_OWNER"
// ],
// "type": "string"
// },
// "Status": {
// "description": "The status of the delegation.",
// "enum": [
// "IN_PROGRESS",
// "UNDER_REVIEW",
// "COMPLETE"
// ],
// "type": "string"
// }
// },
// "type": "object"
// },
// "type": "array"
// }
"delegations": schema.ListNestedAttribute{ /*START ATTRIBUTE*/
NestedObject: schema.NestedAttributeObject{ /*START NESTED OBJECT*/
Attributes: map[string]schema.Attribute{ /*START SCHEMA*/
// Property: AssessmentId
"assessment_id": schema.StringAttribute{ /*START ATTRIBUTE*/
Computed: true,
}, /*END ATTRIBUTE*/
// Property: AssessmentName
"assessment_name": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The name of the related assessment.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Comment
"comment": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The comment related to the delegation.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: ControlSetId
"control_set_id": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The identifier for the specified control set.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: CreatedBy
"created_by": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The IAM user or role that performed the action.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: CreationTime
"creation_time": schema.Float64Attribute{ /*START ATTRIBUTE*/
Description: "The sequence of characters that identifies when the event occurred.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Id
"id": schema.StringAttribute{ /*START ATTRIBUTE*/
Computed: true,
}, /*END ATTRIBUTE*/
// Property: LastUpdated
"last_updated": schema.Float64Attribute{ /*START ATTRIBUTE*/
Description: "The sequence of characters that identifies when the event occurred.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: RoleArn
"role_arn": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The Amazon Resource Name (ARN) of the IAM user or role.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: RoleType
"role_type": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: " The IAM role type.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Status
"status": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The status of the delegation.",
Computed: true,
}, /*END ATTRIBUTE*/
}, /*END SCHEMA*/
}, /*END NESTED OBJECT*/
Description: "The list of delegations.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Description
// CloudFormation resource type schema:
//
// {
// "description": "The description of the specified assessment.",
// "type": "string"
// }
"description": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The description of the specified assessment.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: FrameworkId
// CloudFormation resource type schema:
//
// {
// "description": "The identifier for the specified framework.",
// "maxLength": 36,
// "minLength": 32,
// "pattern": "^([a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}|.*\\S.*)$",
// "type": "string"
// }
"framework_id": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The identifier for the specified framework.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Name
// CloudFormation resource type schema:
//
// {
// "description": "The name of the related assessment.",
// "maxLength": 127,
// "minLength": 1,
// "pattern": "^[a-zA-Z0-9-_\\.]+$",
// "type": "string"
// }
"name": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The name of the related assessment.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Roles
// CloudFormation resource type schema:
//
// {
// "description": "The list of roles for the specified assessment.",
// "items": {
// "additionalProperties": false,
// "description": "The wrapper that contains AWS Audit Manager role information, such as the role type and IAM ARN.",
// "properties": {
// "RoleArn": {
// "description": "The Amazon Resource Name (ARN) of the IAM user or role.",
// "maxLength": 2048,
// "minLength": 20,
// "pattern": "^arn:.*:iam:.*",
// "type": "string"
// },
// "RoleType": {
// "description": " The IAM role type.",
// "enum": [
// "PROCESS_OWNER",
// "RESOURCE_OWNER"
// ],
// "type": "string"
// }
// },
// "type": "object"
// },
// "type": "array"
// }
"roles": schema.ListNestedAttribute{ /*START ATTRIBUTE*/
NestedObject: schema.NestedAttributeObject{ /*START NESTED OBJECT*/
Attributes: map[string]schema.Attribute{ /*START SCHEMA*/
// Property: RoleArn
"role_arn": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The Amazon Resource Name (ARN) of the IAM user or role.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: RoleType
"role_type": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: " The IAM role type.",
Computed: true,
}, /*END ATTRIBUTE*/
}, /*END SCHEMA*/
}, /*END NESTED OBJECT*/
Description: "The list of roles for the specified assessment.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Scope
// CloudFormation resource type schema:
//
// {
// "additionalProperties": false,
// "description": "The wrapper that contains the AWS accounts and AWS services in scope for the assessment.",
// "properties": {
// "AwsAccounts": {
// "description": "The AWS accounts included in scope.",
// "items": {
// "additionalProperties": false,
// "description": "The AWS account associated with the assessment.",
// "properties": {
// "EmailAddress": {
// "description": "The unique identifier for the email account.",
// "maxLength": 320,
// "minLength": 1,
// "pattern": "^.*@.*$",
// "type": "string"
// },
// "Id": {
// "description": "The identifier for the specified AWS account.",
// "maxLength": 12,
// "minLength": 12,
// "pattern": "^[0-9]{12}$",
// "type": "string"
// },
// "Name": {
// "description": "The name of the specified AWS account.",
// "maxLength": 50,
// "minLength": 1,
// "pattern": "",
// "type": "string"
// }
// },
// "type": "object"
// },
// "type": "array"
// },
// "AwsServices": {
// "description": "The AWS services included in scope.",
// "items": {
// "additionalProperties": false,
// "description": "An AWS service such as Amazon S3, AWS CloudTrail, and so on.",
// "properties": {
// "ServiceName": {
// "description": "The name of the AWS service.",
// "type": "string"
// }
// },
// "type": "object"
// },
// "type": "array"
// }
// },
// "type": "object"
// }
"scope": schema.SingleNestedAttribute{ /*START ATTRIBUTE*/
Attributes: map[string]schema.Attribute{ /*START SCHEMA*/
// Property: AwsAccounts
"aws_accounts": schema.ListNestedAttribute{ /*START ATTRIBUTE*/
NestedObject: schema.NestedAttributeObject{ /*START NESTED OBJECT*/
Attributes: map[string]schema.Attribute{ /*START SCHEMA*/
// Property: EmailAddress
"email_address": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The unique identifier for the email account.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Id
"id": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The identifier for the specified AWS account.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Name
"name": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The name of the specified AWS account.",
Computed: true,
}, /*END ATTRIBUTE*/
}, /*END SCHEMA*/
}, /*END NESTED OBJECT*/
Description: "The AWS accounts included in scope.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: AwsServices
"aws_services": schema.ListNestedAttribute{ /*START ATTRIBUTE*/
NestedObject: schema.NestedAttributeObject{ /*START NESTED OBJECT*/
Attributes: map[string]schema.Attribute{ /*START SCHEMA*/
// Property: ServiceName
"service_name": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The name of the AWS service.",
Computed: true,
}, /*END ATTRIBUTE*/
}, /*END SCHEMA*/
}, /*END NESTED OBJECT*/
Description: "The AWS services included in scope.",
Computed: true,
}, /*END ATTRIBUTE*/
}, /*END SCHEMA*/
Description: "The wrapper that contains the AWS accounts and AWS services in scope for the assessment.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Status
// CloudFormation resource type schema:
//
// {
// "description": "The status of the specified assessment. ",
// "enum": [
// "ACTIVE",
// "INACTIVE"
// ],
// "type": "string"
// }
"status": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The status of the specified assessment. ",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Tags
// CloudFormation resource type schema:
//
// {
// "description": "The tags associated with the assessment.",
// "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 127 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 1 to 255 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",
// "Value"
// ],
// "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 127 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 1 to 255 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: "The tags associated with the assessment.",
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::AuditManager::Assessment",
Attributes: attributes,
}
var opts generic.DataSourceOptions
opts = opts.WithCloudFormationTypeName("AWS::AuditManager::Assessment").WithTerraformTypeName("awscc_auditmanager_assessment")
opts = opts.WithTerraformSchema(schema)
opts = opts.WithAttributeNameMap(map[string]string{
"arn": "Arn",
"assessment_id": "AssessmentId",
"assessment_name": "AssessmentName",
"assessment_reports_destination": "AssessmentReportsDestination",
"aws_account": "AwsAccount",
"aws_accounts": "AwsAccounts",
"aws_services": "AwsServices",
"comment": "Comment",
"control_set_id": "ControlSetId",
"created_by": "CreatedBy",
"creation_time": "CreationTime",
"delegations": "Delegations",
"description": "Description",
"destination": "Destination",
"destination_type": "DestinationType",
"email_address": "EmailAddress",
"framework_id": "FrameworkId",
"id": "Id",
"key": "Key",
"last_updated": "LastUpdated",
"name": "Name",
"role_arn": "RoleArn",
"role_type": "RoleType",
"roles": "Roles",
"scope": "Scope",
"service_name": "ServiceName",
"status": "Status",
"tags": "Tags",
"value": "Value",
})
v, err := generic.NewSingularDataSource(ctx, opts...)
if err != nil {
return nil, err
}
return v, nil
}