generated from hashicorp/terraform-provider-scaffolding
/
experiment_template_singular_data_source_gen.go
537 lines (524 loc) · 18 KB
/
experiment_template_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
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
// Code generated by generators/singular-data-source/main.go; DO NOT EDIT.
package fis
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_fis_experiment_template", experimentTemplateDataSource)
}
// experimentTemplateDataSource returns the Terraform awscc_fis_experiment_template data source.
// This Terraform data source corresponds to the CloudFormation AWS::FIS::ExperimentTemplate resource.
func experimentTemplateDataSource(ctx context.Context) (datasource.DataSource, error) {
attributes := map[string]schema.Attribute{ /*START SCHEMA*/
// Property: Actions
// CloudFormation resource type schema:
//
// {
// "additionalProperties": false,
// "description": "The actions for the experiment.",
// "patternProperties": {
// "": {
// "additionalProperties": false,
// "description": "Specifies an action for the experiment template.",
// "properties": {
// "ActionId": {
// "description": "The ID of the action.",
// "maxLength": 64,
// "type": "string"
// },
// "Description": {
// "description": "A description for the action.",
// "maxLength": 512,
// "type": "string"
// },
// "Parameters": {
// "additionalProperties": false,
// "description": "The parameters for the action, if applicable.",
// "patternProperties": {
// "": {
// "maxLength": 1024,
// "type": "string"
// }
// },
// "type": "object"
// },
// "StartAfter": {
// "description": "The names of the actions that must be completed before the current action starts.",
// "items": {
// "maxLength": 64,
// "type": "string"
// },
// "type": "array"
// },
// "Targets": {
// "additionalProperties": false,
// "description": "One or more targets for the action.",
// "patternProperties": {
// "": {
// "maxLength": 64,
// "type": "string"
// }
// },
// "type": "object"
// }
// },
// "required": [
// "ActionId"
// ],
// "type": "object"
// }
// },
// "type": "object"
// }
"actions": // Pattern: ""
schema.MapNestedAttribute{ /*START ATTRIBUTE*/
NestedObject: schema.NestedAttributeObject{ /*START NESTED OBJECT*/
Attributes: map[string]schema.Attribute{ /*START SCHEMA*/
// Property: ActionId
"action_id": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The ID of the action.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Description
"description": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "A description for the action.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Parameters
"parameters": // Pattern: ""
schema.MapAttribute{ /*START ATTRIBUTE*/
ElementType: types.StringType,
Description: "The parameters for the action, if applicable.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: StartAfter
"start_after": schema.ListAttribute{ /*START ATTRIBUTE*/
ElementType: types.StringType,
Description: "The names of the actions that must be completed before the current action starts.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Targets
"targets": // Pattern: ""
schema.MapAttribute{ /*START ATTRIBUTE*/
ElementType: types.StringType,
Description: "One or more targets for the action.",
Computed: true,
}, /*END ATTRIBUTE*/
}, /*END SCHEMA*/
}, /*END NESTED OBJECT*/
Description: "The actions for the experiment.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Description
// CloudFormation resource type schema:
//
// {
// "description": "A description for the experiment template.",
// "maxLength": 512,
// "type": "string"
// }
"description": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "A description for the experiment template.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: ExperimentOptions
// CloudFormation resource type schema:
//
// {
// "additionalProperties": false,
// "properties": {
// "AccountTargeting": {
// "description": "The account targeting setting for the experiment template.",
// "enum": [
// "multi-account",
// "single-account"
// ],
// "type": "string"
// },
// "EmptyTargetResolutionMode": {
// "description": "The target resolution failure mode for the experiment template.",
// "enum": [
// "fail",
// "skip"
// ],
// "type": "string"
// }
// },
// "type": "object"
// }
"experiment_options": schema.SingleNestedAttribute{ /*START ATTRIBUTE*/
Attributes: map[string]schema.Attribute{ /*START SCHEMA*/
// Property: AccountTargeting
"account_targeting": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The account targeting setting for the experiment template.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: EmptyTargetResolutionMode
"empty_target_resolution_mode": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The target resolution failure mode for the experiment template.",
Computed: true,
}, /*END ATTRIBUTE*/
}, /*END SCHEMA*/
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Id
// CloudFormation resource type schema:
//
// {
// "type": "string"
// }
"experiment_template_id": schema.StringAttribute{ /*START ATTRIBUTE*/
Computed: true,
}, /*END ATTRIBUTE*/
// Property: LogConfiguration
// CloudFormation resource type schema:
//
// {
// "additionalProperties": false,
// "properties": {
// "CloudWatchLogsConfiguration": {
// "additionalProperties": false,
// "properties": {
// "LogGroupArn": {
// "maxLength": 2048,
// "minLength": 20,
// "type": "string"
// }
// },
// "required": [
// "LogGroupArn"
// ],
// "type": "object"
// },
// "LogSchemaVersion": {
// "minimum": 1,
// "type": "integer"
// },
// "S3Configuration": {
// "additionalProperties": false,
// "properties": {
// "BucketName": {
// "maxLength": 63,
// "minLength": 3,
// "type": "string"
// },
// "Prefix": {
// "maxLength": 1024,
// "minLength": 1,
// "type": "string"
// }
// },
// "required": [
// "BucketName"
// ],
// "type": "object"
// }
// },
// "required": [
// "LogSchemaVersion"
// ],
// "type": "object"
// }
"log_configuration": schema.SingleNestedAttribute{ /*START ATTRIBUTE*/
Attributes: map[string]schema.Attribute{ /*START SCHEMA*/
// Property: CloudWatchLogsConfiguration
"cloudwatch_logs_configuration": schema.SingleNestedAttribute{ /*START ATTRIBUTE*/
Attributes: map[string]schema.Attribute{ /*START SCHEMA*/
// Property: LogGroupArn
"log_group_arn": schema.StringAttribute{ /*START ATTRIBUTE*/
Computed: true,
}, /*END ATTRIBUTE*/
}, /*END SCHEMA*/
Computed: true,
}, /*END ATTRIBUTE*/
// Property: LogSchemaVersion
"log_schema_version": schema.Int64Attribute{ /*START ATTRIBUTE*/
Computed: true,
}, /*END ATTRIBUTE*/
// Property: S3Configuration
"s3_configuration": schema.SingleNestedAttribute{ /*START ATTRIBUTE*/
Attributes: map[string]schema.Attribute{ /*START SCHEMA*/
// Property: BucketName
"bucket_name": schema.StringAttribute{ /*START ATTRIBUTE*/
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Prefix
"prefix": schema.StringAttribute{ /*START ATTRIBUTE*/
Computed: true,
}, /*END ATTRIBUTE*/
}, /*END SCHEMA*/
Computed: true,
}, /*END ATTRIBUTE*/
}, /*END SCHEMA*/
Computed: true,
}, /*END ATTRIBUTE*/
// Property: RoleArn
// CloudFormation resource type schema:
//
// {
// "description": "The Amazon Resource Name (ARN) of an IAM role that grants the AWS FIS service permission to perform service actions on your behalf.",
// "maxLength": 1224,
// "type": "string"
// }
"role_arn": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The Amazon Resource Name (ARN) of an IAM role that grants the AWS FIS service permission to perform service actions on your behalf.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: StopConditions
// CloudFormation resource type schema:
//
// {
// "description": "One or more stop conditions.",
// "items": {
// "additionalProperties": false,
// "properties": {
// "Source": {
// "maxLength": 64,
// "type": "string"
// },
// "Value": {
// "maxLength": 2048,
// "minLength": 20,
// "type": "string"
// }
// },
// "required": [
// "Source"
// ],
// "type": "object"
// },
// "type": "array"
// }
"stop_conditions": schema.ListNestedAttribute{ /*START ATTRIBUTE*/
NestedObject: schema.NestedAttributeObject{ /*START NESTED OBJECT*/
Attributes: map[string]schema.Attribute{ /*START SCHEMA*/
// Property: Source
"source": schema.StringAttribute{ /*START ATTRIBUTE*/
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Value
"value": schema.StringAttribute{ /*START ATTRIBUTE*/
Computed: true,
}, /*END ATTRIBUTE*/
}, /*END SCHEMA*/
}, /*END NESTED OBJECT*/
Description: "One or more stop conditions.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Tags
// CloudFormation resource type schema:
//
// {
// "additionalProperties": false,
// "patternProperties": {
// "": {
// "maxLength": 256,
// "type": "string"
// }
// },
// "type": "object"
// }
"tags": // Pattern: ""
schema.MapAttribute{ /*START ATTRIBUTE*/
ElementType: types.StringType,
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Targets
// CloudFormation resource type schema:
//
// {
// "additionalProperties": false,
// "description": "The targets for the experiment.",
// "patternProperties": {
// "": {
// "additionalProperties": false,
// "description": "Specifies a target for an experiment.",
// "properties": {
// "Filters": {
// "items": {
// "additionalProperties": false,
// "description": "Describes a filter used for the target resource input in an experiment template.",
// "properties": {
// "Path": {
// "description": "The attribute path for the filter.",
// "maxLength": 256,
// "type": "string"
// },
// "Values": {
// "description": "The attribute values for the filter.",
// "items": {
// "maxLength": 128,
// "type": "string"
// },
// "type": "array"
// }
// },
// "required": [
// "Path",
// "Values"
// ],
// "type": "object"
// },
// "type": "array"
// },
// "Parameters": {
// "additionalProperties": false,
// "patternProperties": {
// "": {
// "maxLength": 1024,
// "type": "string"
// }
// },
// "type": "object"
// },
// "ResourceArns": {
// "description": "The Amazon Resource Names (ARNs) of the target resources.",
// "items": {
// "maxLength": 2048,
// "minLength": 20,
// "type": "string"
// },
// "type": "array"
// },
// "ResourceTags": {
// "additionalProperties": false,
// "patternProperties": {
// "": {
// "maxLength": 256,
// "type": "string"
// }
// },
// "type": "object"
// },
// "ResourceType": {
// "description": "The AWS resource type. The resource type must be supported for the specified action.",
// "maxLength": 64,
// "type": "string"
// },
// "SelectionMode": {
// "description": "Scopes the identified resources to a specific number of the resources at random, or a percentage of the resources.",
// "maxLength": 64,
// "type": "string"
// }
// },
// "required": [
// "ResourceType",
// "SelectionMode"
// ],
// "type": "object"
// }
// },
// "type": "object"
// }
"targets": // Pattern: ""
schema.MapNestedAttribute{ /*START ATTRIBUTE*/
NestedObject: schema.NestedAttributeObject{ /*START NESTED OBJECT*/
Attributes: map[string]schema.Attribute{ /*START SCHEMA*/
// Property: Filters
"filters": schema.ListNestedAttribute{ /*START ATTRIBUTE*/
NestedObject: schema.NestedAttributeObject{ /*START NESTED OBJECT*/
Attributes: map[string]schema.Attribute{ /*START SCHEMA*/
// Property: Path
"path": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The attribute path for the filter.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Values
"values": schema.ListAttribute{ /*START ATTRIBUTE*/
ElementType: types.StringType,
Description: "The attribute values for the filter.",
Computed: true,
}, /*END ATTRIBUTE*/
}, /*END SCHEMA*/
}, /*END NESTED OBJECT*/
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Parameters
"parameters": // Pattern: ""
schema.MapAttribute{ /*START ATTRIBUTE*/
ElementType: types.StringType,
Computed: true,
}, /*END ATTRIBUTE*/
// Property: ResourceArns
"resource_arns": schema.ListAttribute{ /*START ATTRIBUTE*/
ElementType: types.StringType,
Description: "The Amazon Resource Names (ARNs) of the target resources.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: ResourceTags
"resource_tags": // Pattern: ""
schema.MapAttribute{ /*START ATTRIBUTE*/
ElementType: types.StringType,
Computed: true,
}, /*END ATTRIBUTE*/
// Property: ResourceType
"resource_type": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The AWS resource type. The resource type must be supported for the specified action.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: SelectionMode
"selection_mode": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "Scopes the identified resources to a specific number of the resources at random, or a percentage of the resources.",
Computed: true,
}, /*END ATTRIBUTE*/
}, /*END SCHEMA*/
}, /*END NESTED OBJECT*/
Description: "The targets for the experiment.",
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::FIS::ExperimentTemplate",
Attributes: attributes,
}
var opts generic.DataSourceOptions
opts = opts.WithCloudFormationTypeName("AWS::FIS::ExperimentTemplate").WithTerraformTypeName("awscc_fis_experiment_template")
opts = opts.WithTerraformSchema(schema)
opts = opts.WithAttributeNameMap(map[string]string{
"account_targeting": "AccountTargeting",
"action_id": "ActionId",
"actions": "Actions",
"bucket_name": "BucketName",
"cloudwatch_logs_configuration": "CloudWatchLogsConfiguration",
"description": "Description",
"empty_target_resolution_mode": "EmptyTargetResolutionMode",
"experiment_options": "ExperimentOptions",
"experiment_template_id": "Id",
"filters": "Filters",
"log_configuration": "LogConfiguration",
"log_group_arn": "LogGroupArn",
"log_schema_version": "LogSchemaVersion",
"parameters": "Parameters",
"path": "Path",
"prefix": "Prefix",
"resource_arns": "ResourceArns",
"resource_tags": "ResourceTags",
"resource_type": "ResourceType",
"role_arn": "RoleArn",
"s3_configuration": "S3Configuration",
"selection_mode": "SelectionMode",
"source": "Source",
"start_after": "StartAfter",
"stop_conditions": "StopConditions",
"tags": "Tags",
"targets": "Targets",
"value": "Value",
"values": "Values",
})
v, err := generic.NewSingularDataSource(ctx, opts...)
if err != nil {
return nil, err
}
return v, nil
}