generated from hashicorp/terraform-provider-scaffolding
/
wireless_device_singular_data_source_gen.go
583 lines (570 loc) · 19.2 KB
/
wireless_device_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
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
// Code generated by generators/singular-data-source/main.go; DO NOT EDIT.
package iotwireless
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_iotwireless_wireless_device", wirelessDeviceDataSource)
}
// wirelessDeviceDataSource returns the Terraform awscc_iotwireless_wireless_device data source.
// This Terraform data source corresponds to the CloudFormation AWS::IoTWireless::WirelessDevice resource.
func wirelessDeviceDataSource(ctx context.Context) (datasource.DataSource, error) {
attributes := map[string]schema.Attribute{ /*START SCHEMA*/
// Property: Arn
// CloudFormation resource type schema:
//
// {
// "description": "Wireless device arn. Returned after successful create.",
// "type": "string"
// }
"arn": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "Wireless device arn. Returned after successful create.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Description
// CloudFormation resource type schema:
//
// {
// "description": "Wireless device description",
// "maxLength": 2048,
// "type": "string"
// }
"description": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "Wireless device description",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: DestinationName
// CloudFormation resource type schema:
//
// {
// "description": "Wireless device destination name",
// "maxLength": 128,
// "type": "string"
// }
"destination_name": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "Wireless device destination name",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Id
// CloudFormation resource type schema:
//
// {
// "description": "Wireless device Id. Returned after successful create.",
// "maxLength": 256,
// "type": "string"
// }
"wireless_device_id": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "Wireless device Id. Returned after successful create.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: LastUplinkReceivedAt
// CloudFormation resource type schema:
//
// {
// "description": "The date and time when the most recent uplink was received.",
// "type": "string"
// }
"last_uplink_received_at": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The date and time when the most recent uplink was received.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: LoRaWAN
// CloudFormation resource type schema:
//
// {
// "additionalProperties": false,
// "description": "The combination of Package, Station and Model which represents the version of the LoRaWAN Wireless Device.",
// "oneOf": [
// {
// "required": [
// "OtaaV11"
// ]
// },
// {
// "required": [
// "OtaaV10x"
// ]
// },
// {
// "required": [
// "AbpV11"
// ]
// },
// {
// "required": [
// "AbpV10x"
// ]
// }
// ],
// "properties": {
// "AbpV10x": {
// "additionalProperties": false,
// "properties": {
// "DevAddr": {
// "pattern": "[a-fA-F0-9]{8}",
// "type": "string"
// },
// "SessionKeys": {
// "additionalProperties": false,
// "properties": {
// "AppSKey": {
// "pattern": "[a-fA-F0-9]{32}",
// "type": "string"
// },
// "NwkSKey": {
// "pattern": "[a-fA-F0-9]{32}",
// "type": "string"
// }
// },
// "required": [
// "NwkSKey",
// "AppSKey"
// ],
// "type": "object"
// }
// },
// "required": [
// "DevAddr",
// "SessionKeys"
// ],
// "type": "object"
// },
// "AbpV11": {
// "additionalProperties": false,
// "properties": {
// "DevAddr": {
// "pattern": "[a-fA-F0-9]{8}",
// "type": "string"
// },
// "SessionKeys": {
// "additionalProperties": false,
// "properties": {
// "AppSKey": {
// "pattern": "[a-fA-F0-9]{32}",
// "type": "string"
// },
// "FNwkSIntKey": {
// "pattern": "[a-fA-F0-9]{32}",
// "type": "string"
// },
// "NwkSEncKey": {
// "pattern": "[a-fA-F0-9]{32}",
// "type": "string"
// },
// "SNwkSIntKey": {
// "pattern": "[a-fA-F0-9]{32}",
// "type": "string"
// }
// },
// "required": [
// "FNwkSIntKey",
// "SNwkSIntKey",
// "NwkSEncKey",
// "AppSKey"
// ],
// "type": "object"
// }
// },
// "required": [
// "DevAddr",
// "SessionKeys"
// ],
// "type": "object"
// },
// "DevEui": {
// "pattern": "[a-f0-9]{16}",
// "type": "string"
// },
// "DeviceProfileId": {
// "maxLength": 256,
// "type": "string"
// },
// "FPorts": {
// "additionalProperties": false,
// "properties": {
// "Applications": {
// "description": "A list of optional LoRaWAN application information, which can be used for geolocation.",
// "insertionOrder": false,
// "items": {
// "additionalProperties": false,
// "description": "LoRaWAN application configuration, which can be used to perform geolocation.",
// "properties": {
// "DestinationName": {
// "description": "The name of the position data destination that describes the AWS IoT rule that processes the device's position data for use by AWS IoT Core for LoRaWAN.",
// "maxLength": 128,
// "pattern": "[a-zA-Z0-9-_]+",
// "type": "string"
// },
// "FPort": {
// "description": "The Fport value.",
// "maximum": 223,
// "minimum": 1,
// "type": "integer"
// },
// "Type": {
// "description": "Application type, which can be specified to obtain real-time position information of your LoRaWAN device.",
// "enum": [
// "SemtechGeolocation"
// ],
// "type": "string"
// }
// },
// "type": "object"
// },
// "type": "array",
// "uniqueItems": true
// }
// },
// "type": "object"
// },
// "OtaaV10x": {
// "additionalProperties": false,
// "properties": {
// "AppEui": {
// "pattern": "[a-fA-F0-9]{16}",
// "type": "string"
// },
// "AppKey": {
// "pattern": "[a-fA-F0-9]{32}",
// "type": "string"
// }
// },
// "required": [
// "AppKey",
// "AppEui"
// ],
// "type": "object"
// },
// "OtaaV11": {
// "additionalProperties": false,
// "properties": {
// "AppKey": {
// "pattern": "[a-fA-F0-9]{32}",
// "type": "string"
// },
// "JoinEui": {
// "pattern": "[a-fA-F0-9]{16}",
// "type": "string"
// },
// "NwkKey": {
// "pattern": "[a-fA-F0-9]{32}",
// "type": "string"
// }
// },
// "required": [
// "AppKey",
// "NwkKey",
// "JoinEui"
// ],
// "type": "object"
// },
// "ServiceProfileId": {
// "maxLength": 256,
// "type": "string"
// }
// },
// "type": "object"
// }
"lo_ra_wan": schema.SingleNestedAttribute{ /*START ATTRIBUTE*/
Attributes: map[string]schema.Attribute{ /*START SCHEMA*/
// Property: AbpV10x
"abp_v10_x": schema.SingleNestedAttribute{ /*START ATTRIBUTE*/
Attributes: map[string]schema.Attribute{ /*START SCHEMA*/
// Property: DevAddr
"dev_addr": schema.StringAttribute{ /*START ATTRIBUTE*/
Computed: true,
}, /*END ATTRIBUTE*/
// Property: SessionKeys
"session_keys": schema.SingleNestedAttribute{ /*START ATTRIBUTE*/
Attributes: map[string]schema.Attribute{ /*START SCHEMA*/
// Property: AppSKey
"app_s_key": schema.StringAttribute{ /*START ATTRIBUTE*/
Computed: true,
}, /*END ATTRIBUTE*/
// Property: NwkSKey
"nwk_s_key": schema.StringAttribute{ /*START ATTRIBUTE*/
Computed: true,
}, /*END ATTRIBUTE*/
}, /*END SCHEMA*/
Computed: true,
}, /*END ATTRIBUTE*/
}, /*END SCHEMA*/
Computed: true,
}, /*END ATTRIBUTE*/
// Property: AbpV11
"abp_v11": schema.SingleNestedAttribute{ /*START ATTRIBUTE*/
Attributes: map[string]schema.Attribute{ /*START SCHEMA*/
// Property: DevAddr
"dev_addr": schema.StringAttribute{ /*START ATTRIBUTE*/
Computed: true,
}, /*END ATTRIBUTE*/
// Property: SessionKeys
"session_keys": schema.SingleNestedAttribute{ /*START ATTRIBUTE*/
Attributes: map[string]schema.Attribute{ /*START SCHEMA*/
// Property: AppSKey
"app_s_key": schema.StringAttribute{ /*START ATTRIBUTE*/
Computed: true,
}, /*END ATTRIBUTE*/
// Property: FNwkSIntKey
"f_nwk_s_int_key": schema.StringAttribute{ /*START ATTRIBUTE*/
Computed: true,
}, /*END ATTRIBUTE*/
// Property: NwkSEncKey
"nwk_s_enc_key": schema.StringAttribute{ /*START ATTRIBUTE*/
Computed: true,
}, /*END ATTRIBUTE*/
// Property: SNwkSIntKey
"s_nwk_s_int_key": schema.StringAttribute{ /*START ATTRIBUTE*/
Computed: true,
}, /*END ATTRIBUTE*/
}, /*END SCHEMA*/
Computed: true,
}, /*END ATTRIBUTE*/
}, /*END SCHEMA*/
Computed: true,
}, /*END ATTRIBUTE*/
// Property: DevEui
"dev_eui": schema.StringAttribute{ /*START ATTRIBUTE*/
Computed: true,
}, /*END ATTRIBUTE*/
// Property: DeviceProfileId
"device_profile_id": schema.StringAttribute{ /*START ATTRIBUTE*/
Computed: true,
}, /*END ATTRIBUTE*/
// Property: FPorts
"f_ports": schema.SingleNestedAttribute{ /*START ATTRIBUTE*/
Attributes: map[string]schema.Attribute{ /*START SCHEMA*/
// Property: Applications
"applications": schema.SetNestedAttribute{ /*START ATTRIBUTE*/
NestedObject: schema.NestedAttributeObject{ /*START NESTED OBJECT*/
Attributes: map[string]schema.Attribute{ /*START SCHEMA*/
// Property: DestinationName
"destination_name": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The name of the position data destination that describes the AWS IoT rule that processes the device's position data for use by AWS IoT Core for LoRaWAN.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: FPort
"f_port": schema.Int64Attribute{ /*START ATTRIBUTE*/
Description: "The Fport value.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Type
"type": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "Application type, which can be specified to obtain real-time position information of your LoRaWAN device.",
Computed: true,
}, /*END ATTRIBUTE*/
}, /*END SCHEMA*/
}, /*END NESTED OBJECT*/
Description: "A list of optional LoRaWAN application information, which can be used for geolocation.",
Computed: true,
}, /*END ATTRIBUTE*/
}, /*END SCHEMA*/
Computed: true,
}, /*END ATTRIBUTE*/
// Property: OtaaV10x
"otaa_v10_x": schema.SingleNestedAttribute{ /*START ATTRIBUTE*/
Attributes: map[string]schema.Attribute{ /*START SCHEMA*/
// Property: AppEui
"app_eui": schema.StringAttribute{ /*START ATTRIBUTE*/
Computed: true,
}, /*END ATTRIBUTE*/
// Property: AppKey
"app_key": schema.StringAttribute{ /*START ATTRIBUTE*/
Computed: true,
}, /*END ATTRIBUTE*/
}, /*END SCHEMA*/
Computed: true,
}, /*END ATTRIBUTE*/
// Property: OtaaV11
"otaa_v11": schema.SingleNestedAttribute{ /*START ATTRIBUTE*/
Attributes: map[string]schema.Attribute{ /*START SCHEMA*/
// Property: AppKey
"app_key": schema.StringAttribute{ /*START ATTRIBUTE*/
Computed: true,
}, /*END ATTRIBUTE*/
// Property: JoinEui
"join_eui": schema.StringAttribute{ /*START ATTRIBUTE*/
Computed: true,
}, /*END ATTRIBUTE*/
// Property: NwkKey
"nwk_key": schema.StringAttribute{ /*START ATTRIBUTE*/
Computed: true,
}, /*END ATTRIBUTE*/
}, /*END SCHEMA*/
Computed: true,
}, /*END ATTRIBUTE*/
// Property: ServiceProfileId
"service_profile_id": schema.StringAttribute{ /*START ATTRIBUTE*/
Computed: true,
}, /*END ATTRIBUTE*/
}, /*END SCHEMA*/
Description: "The combination of Package, Station and Model which represents the version of the LoRaWAN Wireless Device.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Name
// CloudFormation resource type schema:
//
// {
// "description": "Wireless device name",
// "maxLength": 256,
// "type": "string"
// }
"name": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "Wireless device name",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Positioning
// CloudFormation resource type schema:
//
// {
// "description": "FPort values for the GNSS, stream, and ClockSync functions of the positioning information.",
// "enum": [
// "Enabled",
// "Disabled"
// ],
// "type": "string"
// }
"positioning": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "FPort values for the GNSS, stream, and ClockSync functions of the positioning information.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Tags
// CloudFormation resource type schema:
//
// {
// "description": "A list of key-value pairs that contain metadata for the device. Currently not supported, will not create if tags are passed.",
// "insertionOrder": false,
// "items": {
// "additionalProperties": false,
// "properties": {
// "Key": {
// "maxLength": 128,
// "minLength": 1,
// "type": "string"
// },
// "Value": {
// "maxLength": 256,
// "minLength": 0,
// "type": "string"
// }
// },
// "type": "object"
// },
// "maxItems": 200,
// "type": "array",
// "uniqueItems": true
// }
"tags": schema.SetNestedAttribute{ /*START ATTRIBUTE*/
NestedObject: schema.NestedAttributeObject{ /*START NESTED OBJECT*/
Attributes: map[string]schema.Attribute{ /*START SCHEMA*/
// Property: Key
"key": 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: "A list of key-value pairs that contain metadata for the device. Currently not supported, will not create if tags are passed.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: ThingArn
// CloudFormation resource type schema:
//
// {
// "description": "Thing arn. Passed into update to associate Thing with Wireless device.",
// "type": "string"
// }
"thing_arn": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "Thing arn. Passed into update to associate Thing with Wireless device.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: ThingName
// CloudFormation resource type schema:
//
// {
// "description": "Thing Arn. If there is a Thing created, this can be returned with a Get call.",
// "type": "string"
// }
"thing_name": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "Thing Arn. If there is a Thing created, this can be returned with a Get call.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Type
// CloudFormation resource type schema:
//
// {
// "description": "Wireless device type, currently only Sidewalk and LoRa",
// "enum": [
// "Sidewalk",
// "LoRaWAN"
// ],
// "type": "string"
// }
"type": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "Wireless device type, currently only Sidewalk and LoRa",
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::IoTWireless::WirelessDevice",
Attributes: attributes,
}
var opts generic.DataSourceOptions
opts = opts.WithCloudFormationTypeName("AWS::IoTWireless::WirelessDevice").WithTerraformTypeName("awscc_iotwireless_wireless_device")
opts = opts.WithTerraformSchema(schema)
opts = opts.WithAttributeNameMap(map[string]string{
"abp_v10_x": "AbpV10x",
"abp_v11": "AbpV11",
"app_eui": "AppEui",
"app_key": "AppKey",
"app_s_key": "AppSKey",
"applications": "Applications",
"arn": "Arn",
"description": "Description",
"destination_name": "DestinationName",
"dev_addr": "DevAddr",
"dev_eui": "DevEui",
"device_profile_id": "DeviceProfileId",
"f_nwk_s_int_key": "FNwkSIntKey",
"f_port": "FPort",
"f_ports": "FPorts",
"join_eui": "JoinEui",
"key": "Key",
"last_uplink_received_at": "LastUplinkReceivedAt",
"lo_ra_wan": "LoRaWAN",
"name": "Name",
"nwk_key": "NwkKey",
"nwk_s_enc_key": "NwkSEncKey",
"nwk_s_key": "NwkSKey",
"otaa_v10_x": "OtaaV10x",
"otaa_v11": "OtaaV11",
"positioning": "Positioning",
"s_nwk_s_int_key": "SNwkSIntKey",
"service_profile_id": "ServiceProfileId",
"session_keys": "SessionKeys",
"tags": "Tags",
"thing_arn": "ThingArn",
"thing_name": "ThingName",
"type": "Type",
"value": "Value",
"wireless_device_id": "Id",
})
v, err := generic.NewSingularDataSource(ctx, opts...)
if err != nil {
return nil, err
}
return v, nil
}