generated from hashicorp/terraform-provider-scaffolding
/
workspace_singular_data_source_gen.go
734 lines (721 loc) · 28.6 KB
/
workspace_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
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
// Code generated by generators/singular-data-source/main.go; DO NOT EDIT.
package grafana
import (
"context"
"github.com/hashicorp/terraform-plugin-framework-timetypes/timetypes"
"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_grafana_workspace", workspaceDataSource)
}
// workspaceDataSource returns the Terraform awscc_grafana_workspace data source.
// This Terraform data source corresponds to the CloudFormation AWS::Grafana::Workspace resource.
func workspaceDataSource(ctx context.Context) (datasource.DataSource, error) {
attributes := map[string]schema.Attribute{ /*START SCHEMA*/
// Property: AccountAccessType
// CloudFormation resource type schema:
//
// {
// "description": "These enums represent valid account access types. Specifically these enums determine whether the workspace can access AWS resources in the AWS account only, or whether it can also access resources in other accounts in the same organization. If the value CURRENT_ACCOUNT is used, a workspace role ARN must be provided. If the value is ORGANIZATION, a list of organizational units must be provided.",
// "enum": [
// "CURRENT_ACCOUNT",
// "ORGANIZATION"
// ],
// "type": "string"
// }
"account_access_type": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "These enums represent valid account access types. Specifically these enums determine whether the workspace can access AWS resources in the AWS account only, or whether it can also access resources in other accounts in the same organization. If the value CURRENT_ACCOUNT is used, a workspace role ARN must be provided. If the value is ORGANIZATION, a list of organizational units must be provided.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: AuthenticationProviders
// CloudFormation resource type schema:
//
// {
// "description": "List of authentication providers to enable.",
// "insertionOrder": false,
// "items": {
// "description": "Valid workspace authentication providers.",
// "enum": [
// "AWS_SSO",
// "SAML"
// ],
// "type": "string"
// },
// "minItems": 1,
// "type": "array",
// "uniqueItems": true
// }
"authentication_providers": schema.SetAttribute{ /*START ATTRIBUTE*/
ElementType: types.StringType,
Description: "List of authentication providers to enable.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: ClientToken
// CloudFormation resource type schema:
//
// {
// "description": "A unique, case-sensitive, user-provided identifier to ensure the idempotency of the request.",
// "pattern": "^[!-~]{1,64}$",
// "type": "string"
// }
"client_token": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "A unique, case-sensitive, user-provided identifier to ensure the idempotency of the request.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: CreationTimestamp
// CloudFormation resource type schema:
//
// {
// "description": "Timestamp when the workspace was created.",
// "format": "date-time",
// "type": "string"
// }
"creation_timestamp": schema.StringAttribute{ /*START ATTRIBUTE*/
CustomType: timetypes.RFC3339Type{},
Description: "Timestamp when the workspace was created.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: DataSources
// CloudFormation resource type schema:
//
// {
// "description": "List of data sources on the service managed IAM role.",
// "insertionOrder": false,
// "items": {
// "description": "These enums represent valid AWS data sources that can be queried via the Grafana workspace. These data sources are primarily used to help customers visualize which data sources have been added to a service managed workspace IAM role.",
// "enum": [
// "AMAZON_OPENSEARCH_SERVICE",
// "CLOUDWATCH",
// "PROMETHEUS",
// "XRAY",
// "TIMESTREAM",
// "SITEWISE",
// "ATHENA",
// "REDSHIFT"
// ],
// "type": "string"
// },
// "type": "array"
// }
"data_sources": schema.ListAttribute{ /*START ATTRIBUTE*/
ElementType: types.StringType,
Description: "List of data sources on the service managed IAM role.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Description
// CloudFormation resource type schema:
//
// {
// "description": "Description of a workspace.",
// "maxLength": 2048,
// "minLength": 0,
// "type": "string"
// }
"description": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "Description of a workspace.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Endpoint
// CloudFormation resource type schema:
//
// {
// "description": "Endpoint for the Grafana workspace.",
// "maxLength": 2048,
// "minLength": 1,
// "type": "string"
// }
"endpoint": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "Endpoint for the Grafana workspace.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: GrafanaVersion
// CloudFormation resource type schema:
//
// {
// "description": "The version of Grafana to support in your workspace.",
// "maxLength": 255,
// "minLength": 1,
// "type": "string"
// }
"grafana_version": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The version of Grafana to support in your workspace.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Id
// CloudFormation resource type schema:
//
// {
// "description": "The id that uniquely identifies a Grafana workspace.",
// "pattern": "^g-[0-9a-f]{10}$",
// "type": "string"
// }
"workspace_id": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The id that uniquely identifies a Grafana workspace.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: ModificationTimestamp
// CloudFormation resource type schema:
//
// {
// "description": "Timestamp when the workspace was last modified",
// "format": "date-time",
// "type": "string"
// }
"modification_timestamp": schema.StringAttribute{ /*START ATTRIBUTE*/
CustomType: timetypes.RFC3339Type{},
Description: "Timestamp when the workspace was last modified",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Name
// CloudFormation resource type schema:
//
// {
// "description": "The user friendly name of a workspace.",
// "pattern": "^[a-zA-Z0-9-._~]{1,255}$",
// "type": "string"
// }
"name": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The user friendly name of a workspace.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: NetworkAccessControl
// CloudFormation resource type schema:
//
// {
// "additionalProperties": false,
// "description": "The configuration settings for Network Access Control.",
// "properties": {
// "PrefixListIds": {
// "description": "The list of prefix list IDs. A prefix list is a list of CIDR ranges of IP addresses. The IP addresses specified are allowed to access your workspace. If the list is not included in the configuration then no IP addresses will be allowed to access the workspace.",
// "insertionOrder": false,
// "items": {
// "description": "Prefix List Ids",
// "minLength": 1,
// "type": "string"
// },
// "maxItems": 5,
// "minItems": 0,
// "type": "array",
// "uniqueItems": true
// },
// "VpceIds": {
// "description": "The list of Amazon VPC endpoint IDs for the workspace. If a NetworkAccessConfiguration is specified then only VPC endpoints specified here will be allowed to access the workspace.",
// "insertionOrder": false,
// "items": {
// "description": "VPCE Ids",
// "minLength": 1,
// "type": "string"
// },
// "maxItems": 5,
// "minItems": 0,
// "type": "array",
// "uniqueItems": true
// }
// },
// "type": "object"
// }
"network_access_control": schema.SingleNestedAttribute{ /*START ATTRIBUTE*/
Attributes: map[string]schema.Attribute{ /*START SCHEMA*/
// Property: PrefixListIds
"prefix_list_ids": schema.SetAttribute{ /*START ATTRIBUTE*/
ElementType: types.StringType,
Description: "The list of prefix list IDs. A prefix list is a list of CIDR ranges of IP addresses. The IP addresses specified are allowed to access your workspace. If the list is not included in the configuration then no IP addresses will be allowed to access the workspace.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: VpceIds
"vpce_ids": schema.SetAttribute{ /*START ATTRIBUTE*/
ElementType: types.StringType,
Description: "The list of Amazon VPC endpoint IDs for the workspace. If a NetworkAccessConfiguration is specified then only VPC endpoints specified here will be allowed to access the workspace.",
Computed: true,
}, /*END ATTRIBUTE*/
}, /*END SCHEMA*/
Description: "The configuration settings for Network Access Control.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: NotificationDestinations
// CloudFormation resource type schema:
//
// {
// "description": "List of notification destinations on the customers service managed IAM role that the Grafana workspace can query.",
// "insertionOrder": false,
// "items": {
// "description": "These enums represent valid AWS notification destinations that the Grafana workspace has permission to use. These notification destinations are primarily used to help customers visualize which destinations have been added to a service managed IAM role.",
// "enum": [
// "SNS"
// ],
// "type": "string"
// },
// "type": "array"
// }
"notification_destinations": schema.ListAttribute{ /*START ATTRIBUTE*/
ElementType: types.StringType,
Description: "List of notification destinations on the customers service managed IAM role that the Grafana workspace can query.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: OrganizationRoleName
// CloudFormation resource type schema:
//
// {
// "description": "The name of an IAM role that already exists to use with AWS Organizations to access AWS data sources and notification channels in other accounts in an organization.",
// "maxLength": 2048,
// "minLength": 1,
// "type": "string"
// }
"organization_role_name": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The name of an IAM role that already exists to use with AWS Organizations to access AWS data sources and notification channels in other accounts in an organization.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: OrganizationalUnits
// CloudFormation resource type schema:
//
// {
// "description": "List of Organizational Units containing AWS accounts the Grafana workspace can pull data from.",
// "insertionOrder": false,
// "items": {
// "description": "Id of an organizational unit.",
// "type": "string"
// },
// "type": "array"
// }
"organizational_units": schema.ListAttribute{ /*START ATTRIBUTE*/
ElementType: types.StringType,
Description: "List of Organizational Units containing AWS accounts the Grafana workspace can pull data from.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: PermissionType
// CloudFormation resource type schema:
//
// {
// "description": "These enums represent valid permission types to use when creating or configuring a Grafana workspace. The SERVICE_MANAGED permission type means the Managed Grafana service will create a workspace IAM role on your behalf. The CUSTOMER_MANAGED permission type means that the customer is expected to provide an IAM role that the Grafana workspace can use to query data sources.",
// "enum": [
// "CUSTOMER_MANAGED",
// "SERVICE_MANAGED"
// ],
// "type": "string"
// }
"permission_type": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "These enums represent valid permission types to use when creating or configuring a Grafana workspace. The SERVICE_MANAGED permission type means the Managed Grafana service will create a workspace IAM role on your behalf. The CUSTOMER_MANAGED permission type means that the customer is expected to provide an IAM role that the Grafana workspace can use to query data sources.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: PluginAdminEnabled
// CloudFormation resource type schema:
//
// {
// "description": "Allow workspace admins to install plugins",
// "type": "boolean"
// }
"plugin_admin_enabled": schema.BoolAttribute{ /*START ATTRIBUTE*/
Description: "Allow workspace admins to install plugins",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: RoleArn
// CloudFormation resource type schema:
//
// {
// "description": "IAM Role that will be used to grant the Grafana workspace access to a customers AWS resources.",
// "maxLength": 2048,
// "minLength": 1,
// "type": "string"
// }
"role_arn": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "IAM Role that will be used to grant the Grafana workspace access to a customers AWS resources.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: SamlConfiguration
// CloudFormation resource type schema:
//
// {
// "additionalProperties": false,
// "description": "SAML configuration data associated with an AMG workspace.",
// "properties": {
// "AllowedOrganizations": {
// "description": "List of SAML organizations allowed to access Grafana.",
// "insertionOrder": false,
// "items": {
// "description": "A single SAML organization.",
// "maxLength": 256,
// "minLength": 1,
// "type": "string"
// },
// "type": "array"
// },
// "AssertionAttributes": {
// "additionalProperties": false,
// "description": "Maps Grafana friendly names to the IdPs SAML attributes.",
// "properties": {
// "Email": {
// "description": "Name of the attribute within the SAML assert to use as the users email in Grafana.",
// "maxLength": 256,
// "minLength": 1,
// "type": "string"
// },
// "Groups": {
// "description": "Name of the attribute within the SAML assert to use as the users groups in Grafana.",
// "maxLength": 256,
// "minLength": 1,
// "type": "string"
// },
// "Login": {
// "description": "Name of the attribute within the SAML assert to use as the users login handle in Grafana.",
// "maxLength": 256,
// "minLength": 1,
// "type": "string"
// },
// "Name": {
// "description": "Name of the attribute within the SAML assert to use as the users name in Grafana.",
// "maxLength": 256,
// "minLength": 1,
// "type": "string"
// },
// "Org": {
// "description": "Name of the attribute within the SAML assert to use as the users organizations in Grafana.",
// "maxLength": 256,
// "minLength": 1,
// "type": "string"
// },
// "Role": {
// "description": "Name of the attribute within the SAML assert to use as the users roles in Grafana.",
// "maxLength": 256,
// "minLength": 1,
// "type": "string"
// }
// },
// "type": "object"
// },
// "IdpMetadata": {
// "additionalProperties": false,
// "description": "IdP Metadata used to configure SAML authentication in Grafana.",
// "properties": {
// "Url": {
// "description": "URL that vends the IdPs metadata.",
// "maxLength": 2048,
// "minLength": 1,
// "type": "string"
// },
// "Xml": {
// "description": "XML blob of the IdPs metadata.",
// "type": "string"
// }
// },
// "type": "object"
// },
// "LoginValidityDuration": {
// "description": "The maximum lifetime an authenticated user can be logged in (in minutes) before being required to re-authenticate.",
// "type": "number"
// },
// "RoleValues": {
// "additionalProperties": false,
// "description": "Maps SAML roles to the Grafana Editor and Admin roles.",
// "properties": {
// "Admin": {
// "description": "List of SAML roles which will be mapped into the Grafana Admin role.",
// "insertionOrder": false,
// "items": {
// "description": "A single SAML role.",
// "maxLength": 256,
// "minLength": 1,
// "type": "string"
// },
// "type": "array"
// },
// "Editor": {
// "description": "List of SAML roles which will be mapped into the Grafana Editor role.",
// "insertionOrder": false,
// "items": {
// "description": "A single SAML role.",
// "maxLength": 256,
// "minLength": 1,
// "type": "string"
// },
// "type": "array"
// }
// },
// "type": "object"
// }
// },
// "required": [
// "IdpMetadata"
// ],
// "type": "object"
// }
"saml_configuration": schema.SingleNestedAttribute{ /*START ATTRIBUTE*/
Attributes: map[string]schema.Attribute{ /*START SCHEMA*/
// Property: AllowedOrganizations
"allowed_organizations": schema.ListAttribute{ /*START ATTRIBUTE*/
ElementType: types.StringType,
Description: "List of SAML organizations allowed to access Grafana.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: AssertionAttributes
"assertion_attributes": schema.SingleNestedAttribute{ /*START ATTRIBUTE*/
Attributes: map[string]schema.Attribute{ /*START SCHEMA*/
// Property: Email
"email": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "Name of the attribute within the SAML assert to use as the users email in Grafana.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Groups
"groups": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "Name of the attribute within the SAML assert to use as the users groups in Grafana.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Login
"login": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "Name of the attribute within the SAML assert to use as the users login handle in Grafana.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Name
"name": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "Name of the attribute within the SAML assert to use as the users name in Grafana.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Org
"org": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "Name of the attribute within the SAML assert to use as the users organizations in Grafana.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Role
"role": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "Name of the attribute within the SAML assert to use as the users roles in Grafana.",
Computed: true,
}, /*END ATTRIBUTE*/
}, /*END SCHEMA*/
Description: "Maps Grafana friendly names to the IdPs SAML attributes.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: IdpMetadata
"idp_metadata": schema.SingleNestedAttribute{ /*START ATTRIBUTE*/
Attributes: map[string]schema.Attribute{ /*START SCHEMA*/
// Property: Url
"url": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "URL that vends the IdPs metadata.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Xml
"xml": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "XML blob of the IdPs metadata.",
Computed: true,
}, /*END ATTRIBUTE*/
}, /*END SCHEMA*/
Description: "IdP Metadata used to configure SAML authentication in Grafana.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: LoginValidityDuration
"login_validity_duration": schema.Float64Attribute{ /*START ATTRIBUTE*/
Description: "The maximum lifetime an authenticated user can be logged in (in minutes) before being required to re-authenticate.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: RoleValues
"role_values": schema.SingleNestedAttribute{ /*START ATTRIBUTE*/
Attributes: map[string]schema.Attribute{ /*START SCHEMA*/
// Property: Admin
"admin": schema.ListAttribute{ /*START ATTRIBUTE*/
ElementType: types.StringType,
Description: "List of SAML roles which will be mapped into the Grafana Admin role.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Editor
"editor": schema.ListAttribute{ /*START ATTRIBUTE*/
ElementType: types.StringType,
Description: "List of SAML roles which will be mapped into the Grafana Editor role.",
Computed: true,
}, /*END ATTRIBUTE*/
}, /*END SCHEMA*/
Description: "Maps SAML roles to the Grafana Editor and Admin roles.",
Computed: true,
}, /*END ATTRIBUTE*/
}, /*END SCHEMA*/
Description: "SAML configuration data associated with an AMG workspace.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: SamlConfigurationStatus
// CloudFormation resource type schema:
//
// {
// "description": "Valid SAML configuration statuses.",
// "enum": [
// "CONFIGURED",
// "NOT_CONFIGURED"
// ],
// "type": "string"
// }
"saml_configuration_status": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "Valid SAML configuration statuses.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: SsoClientId
// CloudFormation resource type schema:
//
// {
// "description": "The client ID of the AWS SSO Managed Application.",
// "type": "string"
// }
"sso_client_id": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The client ID of the AWS SSO Managed Application.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: StackSetName
// CloudFormation resource type schema:
//
// {
// "description": "The name of the AWS CloudFormation stack set to use to generate IAM roles to be used for this workspace.",
// "type": "string"
// }
"stack_set_name": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The name of the AWS CloudFormation stack set to use to generate IAM roles to be used for this workspace.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Status
// CloudFormation resource type schema:
//
// {
// "description": "These enums represent the status of a workspace.",
// "enum": [
// "ACTIVE",
// "CREATING",
// "DELETING",
// "FAILED",
// "UPDATING",
// "UPGRADING",
// "VERSION_UPDATING",
// "DELETION_FAILED",
// "CREATION_FAILED",
// "UPDATE_FAILED",
// "UPGRADE_FAILED",
// "LICENSE_REMOVAL_FAILED",
// "VERSION_UPDATE_FAILED"
// ],
// "type": "string"
// }
"status": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "These enums represent the status of a workspace.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: VpcConfiguration
// CloudFormation resource type schema:
//
// {
// "additionalProperties": false,
// "description": "The configuration settings for an Amazon VPC that contains data sources for your Grafana workspace to connect to.",
// "properties": {
// "SecurityGroupIds": {
// "description": "The list of Amazon EC2 security group IDs attached to the Amazon VPC for your Grafana workspace to connect.",
// "insertionOrder": false,
// "items": {
// "description": "VPC Security Group Id",
// "maxLength": 255,
// "minLength": 1,
// "type": "string"
// },
// "maxItems": 5,
// "minItems": 1,
// "type": "array",
// "uniqueItems": true
// },
// "SubnetIds": {
// "description": "The list of Amazon EC2 subnet IDs created in the Amazon VPC for your Grafana workspace to connect.",
// "insertionOrder": false,
// "items": {
// "description": "VPC Subnet Id",
// "maxLength": 255,
// "minLength": 1,
// "type": "string"
// },
// "maxItems": 6,
// "minItems": 2,
// "type": "array",
// "uniqueItems": true
// }
// },
// "required": [
// "SecurityGroupIds",
// "SubnetIds"
// ],
// "type": "object"
// }
"vpc_configuration": schema.SingleNestedAttribute{ /*START ATTRIBUTE*/
Attributes: map[string]schema.Attribute{ /*START SCHEMA*/
// Property: SecurityGroupIds
"security_group_ids": schema.SetAttribute{ /*START ATTRIBUTE*/
ElementType: types.StringType,
Description: "The list of Amazon EC2 security group IDs attached to the Amazon VPC for your Grafana workspace to connect.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: SubnetIds
"subnet_ids": schema.SetAttribute{ /*START ATTRIBUTE*/
ElementType: types.StringType,
Description: "The list of Amazon EC2 subnet IDs created in the Amazon VPC for your Grafana workspace to connect.",
Computed: true,
}, /*END ATTRIBUTE*/
}, /*END SCHEMA*/
Description: "The configuration settings for an Amazon VPC that contains data sources for your Grafana workspace to connect to.",
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::Grafana::Workspace",
Attributes: attributes,
}
var opts generic.DataSourceOptions
opts = opts.WithCloudFormationTypeName("AWS::Grafana::Workspace").WithTerraformTypeName("awscc_grafana_workspace")
opts = opts.WithTerraformSchema(schema)
opts = opts.WithAttributeNameMap(map[string]string{
"account_access_type": "AccountAccessType",
"admin": "Admin",
"allowed_organizations": "AllowedOrganizations",
"assertion_attributes": "AssertionAttributes",
"authentication_providers": "AuthenticationProviders",
"client_token": "ClientToken",
"creation_timestamp": "CreationTimestamp",
"data_sources": "DataSources",
"description": "Description",
"editor": "Editor",
"email": "Email",
"endpoint": "Endpoint",
"grafana_version": "GrafanaVersion",
"groups": "Groups",
"idp_metadata": "IdpMetadata",
"login": "Login",
"login_validity_duration": "LoginValidityDuration",
"modification_timestamp": "ModificationTimestamp",
"name": "Name",
"network_access_control": "NetworkAccessControl",
"notification_destinations": "NotificationDestinations",
"org": "Org",
"organization_role_name": "OrganizationRoleName",
"organizational_units": "OrganizationalUnits",
"permission_type": "PermissionType",
"plugin_admin_enabled": "PluginAdminEnabled",
"prefix_list_ids": "PrefixListIds",
"role": "Role",
"role_arn": "RoleArn",
"role_values": "RoleValues",
"saml_configuration": "SamlConfiguration",
"saml_configuration_status": "SamlConfigurationStatus",
"security_group_ids": "SecurityGroupIds",
"sso_client_id": "SsoClientId",
"stack_set_name": "StackSetName",
"status": "Status",
"subnet_ids": "SubnetIds",
"url": "Url",
"vpc_configuration": "VpcConfiguration",
"vpce_ids": "VpceIds",
"workspace_id": "Id",
"xml": "Xml",
})
v, err := generic.NewSingularDataSource(ctx, opts...)
if err != nil {
return nil, err
}
return v, nil
}