generated from hashicorp/terraform-provider-scaffolding
/
launch_profile_singular_data_source_gen.go
480 lines (467 loc) · 22.7 KB
/
launch_profile_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
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
// Code generated by generators/singular-data-source/main.go; DO NOT EDIT.
package nimblestudio
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_nimblestudio_launch_profile", launchProfileDataSource)
}
// launchProfileDataSource returns the Terraform awscc_nimblestudio_launch_profile data source.
// This Terraform data source corresponds to the CloudFormation AWS::NimbleStudio::LaunchProfile resource.
func launchProfileDataSource(ctx context.Context) (datasource.DataSource, error) {
attributes := map[string]schema.Attribute{ /*START SCHEMA*/
// Property: Description
// CloudFormation resource type schema:
//
// {
// "description": "\u003cp\u003eThe description.\u003c/p\u003e",
// "maxLength": 256,
// "minLength": 0,
// "type": "string"
// }
"description": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "<p>The description.</p>",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Ec2SubnetIds
// CloudFormation resource type schema:
//
// {
// "description": "\u003cp\u003eSpecifies the IDs of the EC2 subnets where streaming sessions will be accessible from.\n These subnets must support the specified instance types. \u003c/p\u003e",
// "items": {
// "type": "string"
// },
// "maxItems": 6,
// "minItems": 0,
// "type": "array"
// }
"ec_2_subnet_ids": schema.ListAttribute{ /*START ATTRIBUTE*/
ElementType: types.StringType,
Description: "<p>Specifies the IDs of the EC2 subnets where streaming sessions will be accessible from.\n These subnets must support the specified instance types. </p>",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: LaunchProfileId
// CloudFormation resource type schema:
//
// {
// "type": "string"
// }
"launch_profile_id": schema.StringAttribute{ /*START ATTRIBUTE*/
Computed: true,
}, /*END ATTRIBUTE*/
// Property: LaunchProfileProtocolVersions
// CloudFormation resource type schema:
//
// {
// "description": "\u003cp\u003eThe version number of the protocol that is used by the launch profile. The only valid\n version is \"2021-03-31\".\u003c/p\u003e",
// "items": {
// "description": "\u003cp\u003eThe version number of the protocol that is used by the launch profile. The only valid\n version is \"2021-03-31\".\u003c/p\u003e",
// "maxLength": 10,
// "minLength": 0,
// "pattern": "^2021\\-03\\-31$",
// "type": "string"
// },
// "type": "array"
// }
"launch_profile_protocol_versions": schema.ListAttribute{ /*START ATTRIBUTE*/
ElementType: types.StringType,
Description: "<p>The version number of the protocol that is used by the launch profile. The only valid\n version is \"2021-03-31\".</p>",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Name
// CloudFormation resource type schema:
//
// {
// "description": "\u003cp\u003eThe name for the launch profile.\u003c/p\u003e",
// "maxLength": 64,
// "minLength": 1,
// "type": "string"
// }
"name": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "<p>The name for the launch profile.</p>",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: StreamConfiguration
// CloudFormation resource type schema:
//
// {
// "additionalProperties": false,
// "description": "\u003cp\u003eA configuration for a streaming session.\u003c/p\u003e",
// "properties": {
// "AutomaticTerminationMode": {
// "enum": [
// "DEACTIVATED",
// "ACTIVATED"
// ],
// "type": "string"
// },
// "ClipboardMode": {
// "enum": [
// "ENABLED",
// "DISABLED"
// ],
// "type": "string"
// },
// "Ec2InstanceTypes": {
// "description": "\u003cp\u003eThe EC2 instance types that users can select from when launching a streaming session\n with this launch profile.\u003c/p\u003e",
// "items": {
// "enum": [
// "g4dn.xlarge",
// "g4dn.2xlarge",
// "g4dn.4xlarge",
// "g4dn.8xlarge",
// "g4dn.12xlarge",
// "g4dn.16xlarge",
// "g3.4xlarge",
// "g3s.xlarge",
// "g5.xlarge",
// "g5.2xlarge",
// "g5.4xlarge",
// "g5.8xlarge",
// "g5.16xlarge"
// ],
// "type": "string"
// },
// "maxItems": 30,
// "minItems": 1,
// "type": "array"
// },
// "MaxSessionLengthInMinutes": {
// "default": 690,
// "description": "\u003cp\u003eThe length of time, in minutes, that a streaming session can be active before it is\n stopped or terminated. After this point, Nimble Studio automatically terminates or\n stops the session. The default length of time is 690 minutes, and the maximum length of\n time is 30 days.\u003c/p\u003e",
// "maximum": 43200,
// "minimum": 1,
// "type": "number"
// },
// "MaxStoppedSessionLengthInMinutes": {
// "default": 0,
// "description": "\u003cp\u003eInteger that determines if you can start and stop your sessions and how long a session\n can stay in the \u003ccode\u003eSTOPPED\u003c/code\u003e state. The default value is 0. The maximum value is\n 5760.\u003c/p\u003e\n \u003cp\u003eThis field is allowed only when \u003ccode\u003esessionPersistenceMode\u003c/code\u003e is\n \u003ccode\u003eACTIVATED\u003c/code\u003e and \u003ccode\u003eautomaticTerminationMode\u003c/code\u003e is\n \u003ccode\u003eACTIVATED\u003c/code\u003e.\u003c/p\u003e\n \u003cp\u003eIf the value is set to 0, your sessions can?t be \u003ccode\u003eSTOPPED\u003c/code\u003e. If you then\n call \u003ccode\u003eStopStreamingSession\u003c/code\u003e, the session fails. If the time that a session\n stays in the \u003ccode\u003eREADY\u003c/code\u003e state exceeds the \u003ccode\u003emaxSessionLengthInMinutes\u003c/code\u003e\n value, the session will automatically be terminated (instead of\n \u003ccode\u003eSTOPPED\u003c/code\u003e).\u003c/p\u003e\n \u003cp\u003eIf the value is set to a positive number, the session can be stopped. You can call\n \u003ccode\u003eStopStreamingSession\u003c/code\u003e to stop sessions in the \u003ccode\u003eREADY\u003c/code\u003e state.\n If the time that a session stays in the \u003ccode\u003eREADY\u003c/code\u003e state exceeds the\n \u003ccode\u003emaxSessionLengthInMinutes\u003c/code\u003e value, the session will automatically be\n stopped (instead of terminated).\u003c/p\u003e",
// "maximum": 5760,
// "minimum": 0,
// "type": "number"
// },
// "SessionBackup": {
// "additionalProperties": false,
// "description": "\u003cp\u003eConfigures how streaming sessions are backed up when launched from this launch\n profile.\u003c/p\u003e",
// "properties": {
// "MaxBackupsToRetain": {
// "default": 0,
// "description": "\u003cp\u003eThe maximum number of backups that each streaming session created from this launch\n profile can have.\u003c/p\u003e",
// "maximum": 10,
// "minimum": 0,
// "type": "number"
// },
// "Mode": {
// "enum": [
// "AUTOMATIC",
// "DEACTIVATED"
// ],
// "type": "string"
// }
// },
// "type": "object"
// },
// "SessionPersistenceMode": {
// "enum": [
// "DEACTIVATED",
// "ACTIVATED"
// ],
// "type": "string"
// },
// "SessionStorage": {
// "additionalProperties": false,
// "description": "\u003cp\u003eThe configuration for a streaming session?s upload storage.\u003c/p\u003e",
// "properties": {
// "Mode": {
// "description": "\u003cp\u003eAllows artists to upload files to their workstations. The only valid option is\n \u003ccode\u003eUPLOAD\u003c/code\u003e.\u003c/p\u003e",
// "items": {
// "enum": [
// "UPLOAD"
// ],
// "type": "string"
// },
// "minItems": 1,
// "type": "array"
// },
// "Root": {
// "additionalProperties": false,
// "description": "\u003cp\u003eThe upload storage root location (folder) on streaming workstations where files are\n uploaded.\u003c/p\u003e",
// "properties": {
// "Linux": {
// "description": "\u003cp\u003eThe folder path in Linux workstations where files are uploaded.\u003c/p\u003e",
// "maxLength": 128,
// "minLength": 1,
// "pattern": "^(\\$HOME|/)[/]?([A-Za-z0-9-_]+/)*([A-Za-z0-9_-]+)$",
// "type": "string"
// },
// "Windows": {
// "description": "\u003cp\u003eThe folder path in Windows workstations where files are uploaded.\u003c/p\u003e",
// "maxLength": 128,
// "minLength": 1,
// "pattern": "^((\\%HOMEPATH\\%)|[a-zA-Z]:)[\\\\/](?:[a-zA-Z0-9_-]+[\\\\/])*[a-zA-Z0-9_-]+$",
// "type": "string"
// }
// },
// "type": "object"
// }
// },
// "required": [
// "Mode"
// ],
// "type": "object"
// },
// "StreamingImageIds": {
// "description": "\u003cp\u003eThe streaming images that users can select from when launching a streaming session\n with this launch profile.\u003c/p\u003e",
// "items": {
// "maxLength": 22,
// "minLength": 0,
// "pattern": "^[a-zA-Z0-9-_]*$",
// "type": "string"
// },
// "maxItems": 20,
// "minItems": 1,
// "type": "array"
// },
// "VolumeConfiguration": {
// "additionalProperties": false,
// "description": "\u003cp\u003eCustom volume configuration for the root volumes that are attached to streaming\n sessions.\u003c/p\u003e\n \u003cp\u003eThis parameter is only allowed when \u003ccode\u003esessionPersistenceMode\u003c/code\u003e is\n \u003ccode\u003eACTIVATED\u003c/code\u003e.\u003c/p\u003e",
// "properties": {
// "Iops": {
// "default": 3000,
// "description": "\u003cp\u003eThe number of I/O operations per second for the root volume that is attached to\n streaming session.\u003c/p\u003e",
// "maximum": 16000,
// "minimum": 3000,
// "type": "number"
// },
// "Size": {
// "default": 500,
// "description": "\u003cp\u003eThe size of the root volume that is attached to the streaming session. The root volume\n size is measured in GiBs.\u003c/p\u003e",
// "maximum": 16000,
// "minimum": 100,
// "type": "number"
// },
// "Throughput": {
// "default": 125,
// "description": "\u003cp\u003eThe throughput to provision for the root volume that is attached to the streaming\n session. The throughput is measured in MiB/s.\u003c/p\u003e",
// "maximum": 1000,
// "minimum": 125,
// "type": "number"
// }
// },
// "type": "object"
// }
// },
// "required": [
// "ClipboardMode",
// "Ec2InstanceTypes",
// "StreamingImageIds"
// ],
// "type": "object"
// }
"stream_configuration": schema.SingleNestedAttribute{ /*START ATTRIBUTE*/
Attributes: map[string]schema.Attribute{ /*START SCHEMA*/
// Property: AutomaticTerminationMode
"automatic_termination_mode": schema.StringAttribute{ /*START ATTRIBUTE*/
Computed: true,
}, /*END ATTRIBUTE*/
// Property: ClipboardMode
"clipboard_mode": schema.StringAttribute{ /*START ATTRIBUTE*/
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Ec2InstanceTypes
"ec_2_instance_types": schema.ListAttribute{ /*START ATTRIBUTE*/
ElementType: types.StringType,
Description: "<p>The EC2 instance types that users can select from when launching a streaming session\n with this launch profile.</p>",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: MaxSessionLengthInMinutes
"max_session_length_in_minutes": schema.Float64Attribute{ /*START ATTRIBUTE*/
Description: "<p>The length of time, in minutes, that a streaming session can be active before it is\n stopped or terminated. After this point, Nimble Studio automatically terminates or\n stops the session. The default length of time is 690 minutes, and the maximum length of\n time is 30 days.</p>",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: MaxStoppedSessionLengthInMinutes
"max_stopped_session_length_in_minutes": schema.Float64Attribute{ /*START ATTRIBUTE*/
Description: "<p>Integer that determines if you can start and stop your sessions and how long a session\n can stay in the <code>STOPPED</code> state. The default value is 0. The maximum value is\n 5760.</p>\n <p>This field is allowed only when <code>sessionPersistenceMode</code> is\n <code>ACTIVATED</code> and <code>automaticTerminationMode</code> is\n <code>ACTIVATED</code>.</p>\n <p>If the value is set to 0, your sessions can?t be <code>STOPPED</code>. If you then\n call <code>StopStreamingSession</code>, the session fails. If the time that a session\n stays in the <code>READY</code> state exceeds the <code>maxSessionLengthInMinutes</code>\n value, the session will automatically be terminated (instead of\n <code>STOPPED</code>).</p>\n <p>If the value is set to a positive number, the session can be stopped. You can call\n <code>StopStreamingSession</code> to stop sessions in the <code>READY</code> state.\n If the time that a session stays in the <code>READY</code> state exceeds the\n <code>maxSessionLengthInMinutes</code> value, the session will automatically be\n stopped (instead of terminated).</p>",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: SessionBackup
"session_backup": schema.SingleNestedAttribute{ /*START ATTRIBUTE*/
Attributes: map[string]schema.Attribute{ /*START SCHEMA*/
// Property: MaxBackupsToRetain
"max_backups_to_retain": schema.Float64Attribute{ /*START ATTRIBUTE*/
Description: "<p>The maximum number of backups that each streaming session created from this launch\n profile can have.</p>",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Mode
"mode": schema.StringAttribute{ /*START ATTRIBUTE*/
Computed: true,
}, /*END ATTRIBUTE*/
}, /*END SCHEMA*/
Description: "<p>Configures how streaming sessions are backed up when launched from this launch\n profile.</p>",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: SessionPersistenceMode
"session_persistence_mode": schema.StringAttribute{ /*START ATTRIBUTE*/
Computed: true,
}, /*END ATTRIBUTE*/
// Property: SessionStorage
"session_storage": schema.SingleNestedAttribute{ /*START ATTRIBUTE*/
Attributes: map[string]schema.Attribute{ /*START SCHEMA*/
// Property: Mode
"mode": schema.ListAttribute{ /*START ATTRIBUTE*/
ElementType: types.StringType,
Description: "<p>Allows artists to upload files to their workstations. The only valid option is\n <code>UPLOAD</code>.</p>",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Root
"root": schema.SingleNestedAttribute{ /*START ATTRIBUTE*/
Attributes: map[string]schema.Attribute{ /*START SCHEMA*/
// Property: Linux
"linux": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "<p>The folder path in Linux workstations where files are uploaded.</p>",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Windows
"windows": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "<p>The folder path in Windows workstations where files are uploaded.</p>",
Computed: true,
}, /*END ATTRIBUTE*/
}, /*END SCHEMA*/
Description: "<p>The upload storage root location (folder) on streaming workstations where files are\n uploaded.</p>",
Computed: true,
}, /*END ATTRIBUTE*/
}, /*END SCHEMA*/
Description: "<p>The configuration for a streaming session?s upload storage.</p>",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: StreamingImageIds
"streaming_image_ids": schema.ListAttribute{ /*START ATTRIBUTE*/
ElementType: types.StringType,
Description: "<p>The streaming images that users can select from when launching a streaming session\n with this launch profile.</p>",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: VolumeConfiguration
"volume_configuration": schema.SingleNestedAttribute{ /*START ATTRIBUTE*/
Attributes: map[string]schema.Attribute{ /*START SCHEMA*/
// Property: Iops
"iops": schema.Float64Attribute{ /*START ATTRIBUTE*/
Description: "<p>The number of I/O operations per second for the root volume that is attached to\n streaming session.</p>",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Size
"size": schema.Float64Attribute{ /*START ATTRIBUTE*/
Description: "<p>The size of the root volume that is attached to the streaming session. The root volume\n size is measured in GiBs.</p>",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Throughput
"throughput": schema.Float64Attribute{ /*START ATTRIBUTE*/
Description: "<p>The throughput to provision for the root volume that is attached to the streaming\n session. The throughput is measured in MiB/s.</p>",
Computed: true,
}, /*END ATTRIBUTE*/
}, /*END SCHEMA*/
Description: "<p>Custom volume configuration for the root volumes that are attached to streaming\n sessions.</p>\n <p>This parameter is only allowed when <code>sessionPersistenceMode</code> is\n <code>ACTIVATED</code>.</p>",
Computed: true,
}, /*END ATTRIBUTE*/
}, /*END SCHEMA*/
Description: "<p>A configuration for a streaming session.</p>",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: StudioComponentIds
// CloudFormation resource type schema:
//
// {
// "description": "\u003cp\u003eUnique identifiers for a collection of studio components that can be used with this\n launch profile.\u003c/p\u003e",
// "items": {
// "type": "string"
// },
// "maxItems": 100,
// "minItems": 1,
// "type": "array"
// }
"studio_component_ids": schema.ListAttribute{ /*START ATTRIBUTE*/
ElementType: types.StringType,
Description: "<p>Unique identifiers for a collection of studio components that can be used with this\n launch profile.</p>",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: StudioId
// CloudFormation resource type schema:
//
// {
// "description": "\u003cp\u003eThe studio ID. \u003c/p\u003e",
// "type": "string"
// }
"studio_id": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "<p>The studio ID. </p>",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Tags
// CloudFormation resource type schema:
//
// {
// "additionalProperties": false,
// "patternProperties": {
// "": {
// "type": "string"
// }
// },
// "type": "object"
// }
"tags": // Pattern: ""
schema.MapAttribute{ /*START ATTRIBUTE*/
ElementType: types.StringType,
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::NimbleStudio::LaunchProfile",
Attributes: attributes,
}
var opts generic.DataSourceOptions
opts = opts.WithCloudFormationTypeName("AWS::NimbleStudio::LaunchProfile").WithTerraformTypeName("awscc_nimblestudio_launch_profile")
opts = opts.WithTerraformSchema(schema)
opts = opts.WithAttributeNameMap(map[string]string{
"automatic_termination_mode": "AutomaticTerminationMode",
"clipboard_mode": "ClipboardMode",
"description": "Description",
"ec_2_instance_types": "Ec2InstanceTypes",
"ec_2_subnet_ids": "Ec2SubnetIds",
"iops": "Iops",
"launch_profile_id": "LaunchProfileId",
"launch_profile_protocol_versions": "LaunchProfileProtocolVersions",
"linux": "Linux",
"max_backups_to_retain": "MaxBackupsToRetain",
"max_session_length_in_minutes": "MaxSessionLengthInMinutes",
"max_stopped_session_length_in_minutes": "MaxStoppedSessionLengthInMinutes",
"mode": "Mode",
"name": "Name",
"root": "Root",
"session_backup": "SessionBackup",
"session_persistence_mode": "SessionPersistenceMode",
"session_storage": "SessionStorage",
"size": "Size",
"stream_configuration": "StreamConfiguration",
"streaming_image_ids": "StreamingImageIds",
"studio_component_ids": "StudioComponentIds",
"studio_id": "StudioId",
"tags": "Tags",
"throughput": "Throughput",
"volume_configuration": "VolumeConfiguration",
"windows": "Windows",
})
v, err := generic.NewSingularDataSource(ctx, opts...)
if err != nil {
return nil, err
}
return v, nil
}