generated from hashicorp/terraform-provider-scaffolding
/
workspace_resource_gen.go
1027 lines (1012 loc) · 40 KB
/
workspace_resource_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
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
// Code generated by generators/resource/main.go; DO NOT EDIT.
package grafana
import (
"context"
"regexp"
"github.com/hashicorp/terraform-plugin-framework-timetypes/timetypes"
"github.com/hashicorp/terraform-plugin-framework-validators/listvalidator"
"github.com/hashicorp/terraform-plugin-framework-validators/setvalidator"
"github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator"
"github.com/hashicorp/terraform-plugin-framework/resource"
"github.com/hashicorp/terraform-plugin-framework/resource/schema"
"github.com/hashicorp/terraform-plugin-framework/resource/schema/boolplanmodifier"
"github.com/hashicorp/terraform-plugin-framework/resource/schema/float64planmodifier"
"github.com/hashicorp/terraform-plugin-framework/resource/schema/listplanmodifier"
"github.com/hashicorp/terraform-plugin-framework/resource/schema/objectplanmodifier"
"github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier"
"github.com/hashicorp/terraform-plugin-framework/resource/schema/setplanmodifier"
"github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier"
"github.com/hashicorp/terraform-plugin-framework/schema/validator"
"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.AddResourceFactory("awscc_grafana_workspace", workspaceResource)
}
// workspaceResource returns the Terraform awscc_grafana_workspace resource.
// This Terraform resource corresponds to the CloudFormation AWS::Grafana::Workspace resource.
func workspaceResource(ctx context.Context) (resource.Resource, 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.",
Required: true,
Validators: []validator.String{ /*START VALIDATORS*/
stringvalidator.OneOf(
"CURRENT_ACCOUNT",
"ORGANIZATION",
),
}, /*END VALIDATORS*/
}, /*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.",
Required: true,
Validators: []validator.Set{ /*START VALIDATORS*/
setvalidator.SizeAtLeast(1),
setvalidator.ValueStringsAre(
stringvalidator.OneOf(
"AWS_SSO",
"SAML",
),
),
}, /*END VALIDATORS*/
}, /*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.",
Optional: true,
Computed: true,
Validators: []validator.String{ /*START VALIDATORS*/
stringvalidator.RegexMatches(regexp.MustCompile("^[!-~]{1,64}$"), ""),
}, /*END VALIDATORS*/
PlanModifiers: []planmodifier.String{ /*START PLAN MODIFIERS*/
stringplanmodifier.UseStateForUnknown(),
stringplanmodifier.RequiresReplace(),
}, /*END PLAN MODIFIERS*/
// ClientToken is a write-only property.
}, /*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,
PlanModifiers: []planmodifier.String{ /*START PLAN MODIFIERS*/
stringplanmodifier.UseStateForUnknown(),
}, /*END PLAN MODIFIERS*/
}, /*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.",
Optional: true,
Computed: true,
Validators: []validator.List{ /*START VALIDATORS*/
listvalidator.ValueStringsAre(
stringvalidator.OneOf(
"AMAZON_OPENSEARCH_SERVICE",
"CLOUDWATCH",
"PROMETHEUS",
"XRAY",
"TIMESTREAM",
"SITEWISE",
"ATHENA",
"REDSHIFT",
),
),
}, /*END VALIDATORS*/
PlanModifiers: []planmodifier.List{ /*START PLAN MODIFIERS*/
generic.Multiset(),
listplanmodifier.UseStateForUnknown(),
}, /*END PLAN MODIFIERS*/
}, /*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.",
Optional: true,
Computed: true,
Validators: []validator.String{ /*START VALIDATORS*/
stringvalidator.LengthBetween(0, 2048),
}, /*END VALIDATORS*/
PlanModifiers: []planmodifier.String{ /*START PLAN MODIFIERS*/
stringplanmodifier.UseStateForUnknown(),
}, /*END PLAN MODIFIERS*/
}, /*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,
PlanModifiers: []planmodifier.String{ /*START PLAN MODIFIERS*/
stringplanmodifier.UseStateForUnknown(),
}, /*END PLAN MODIFIERS*/
}, /*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.",
Optional: true,
Computed: true,
Validators: []validator.String{ /*START VALIDATORS*/
stringvalidator.LengthBetween(1, 255),
}, /*END VALIDATORS*/
PlanModifiers: []planmodifier.String{ /*START PLAN MODIFIERS*/
stringplanmodifier.UseStateForUnknown(),
}, /*END PLAN MODIFIERS*/
}, /*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,
PlanModifiers: []planmodifier.String{ /*START PLAN MODIFIERS*/
stringplanmodifier.UseStateForUnknown(),
}, /*END PLAN MODIFIERS*/
}, /*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,
PlanModifiers: []planmodifier.String{ /*START PLAN MODIFIERS*/
stringplanmodifier.UseStateForUnknown(),
}, /*END PLAN MODIFIERS*/
}, /*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.",
Optional: true,
Computed: true,
Validators: []validator.String{ /*START VALIDATORS*/
stringvalidator.RegexMatches(regexp.MustCompile("^[a-zA-Z0-9-._~]{1,255}$"), ""),
}, /*END VALIDATORS*/
PlanModifiers: []planmodifier.String{ /*START PLAN MODIFIERS*/
stringplanmodifier.UseStateForUnknown(),
}, /*END PLAN MODIFIERS*/
}, /*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.",
Optional: true,
Computed: true,
Validators: []validator.Set{ /*START VALIDATORS*/
setvalidator.SizeBetween(0, 5),
setvalidator.ValueStringsAre(
stringvalidator.LengthAtLeast(1),
),
}, /*END VALIDATORS*/
PlanModifiers: []planmodifier.Set{ /*START PLAN MODIFIERS*/
setplanmodifier.UseStateForUnknown(),
}, /*END PLAN MODIFIERS*/
}, /*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.",
Optional: true,
Computed: true,
Validators: []validator.Set{ /*START VALIDATORS*/
setvalidator.SizeBetween(0, 5),
setvalidator.ValueStringsAre(
stringvalidator.LengthAtLeast(1),
),
}, /*END VALIDATORS*/
PlanModifiers: []planmodifier.Set{ /*START PLAN MODIFIERS*/
setplanmodifier.UseStateForUnknown(),
}, /*END PLAN MODIFIERS*/
}, /*END ATTRIBUTE*/
}, /*END SCHEMA*/
Description: "The configuration settings for Network Access Control.",
Optional: true,
Computed: true,
PlanModifiers: []planmodifier.Object{ /*START PLAN MODIFIERS*/
objectplanmodifier.UseStateForUnknown(),
}, /*END PLAN MODIFIERS*/
}, /*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.",
Optional: true,
Computed: true,
Validators: []validator.List{ /*START VALIDATORS*/
listvalidator.ValueStringsAre(
stringvalidator.OneOf(
"SNS",
),
),
}, /*END VALIDATORS*/
PlanModifiers: []planmodifier.List{ /*START PLAN MODIFIERS*/
generic.Multiset(),
listplanmodifier.UseStateForUnknown(),
}, /*END PLAN MODIFIERS*/
}, /*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.",
Optional: true,
Computed: true,
Validators: []validator.String{ /*START VALIDATORS*/
stringvalidator.LengthBetween(1, 2048),
}, /*END VALIDATORS*/
PlanModifiers: []planmodifier.String{ /*START PLAN MODIFIERS*/
stringplanmodifier.UseStateForUnknown(),
}, /*END PLAN MODIFIERS*/
}, /*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.",
Optional: true,
Computed: true,
PlanModifiers: []planmodifier.List{ /*START PLAN MODIFIERS*/
generic.Multiset(),
listplanmodifier.UseStateForUnknown(),
}, /*END PLAN MODIFIERS*/
}, /*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.",
Required: true,
Validators: []validator.String{ /*START VALIDATORS*/
stringvalidator.OneOf(
"CUSTOMER_MANAGED",
"SERVICE_MANAGED",
),
}, /*END VALIDATORS*/
}, /*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",
Optional: true,
Computed: true,
PlanModifiers: []planmodifier.Bool{ /*START PLAN MODIFIERS*/
boolplanmodifier.UseStateForUnknown(),
}, /*END PLAN MODIFIERS*/
}, /*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.",
Optional: true,
Computed: true,
Validators: []validator.String{ /*START VALIDATORS*/
stringvalidator.LengthBetween(1, 2048),
}, /*END VALIDATORS*/
PlanModifiers: []planmodifier.String{ /*START PLAN MODIFIERS*/
stringplanmodifier.UseStateForUnknown(),
}, /*END PLAN MODIFIERS*/
}, /*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.",
Optional: true,
Computed: true,
Validators: []validator.List{ /*START VALIDATORS*/
listvalidator.ValueStringsAre(
stringvalidator.LengthBetween(1, 256),
),
}, /*END VALIDATORS*/
PlanModifiers: []planmodifier.List{ /*START PLAN MODIFIERS*/
generic.Multiset(),
listplanmodifier.UseStateForUnknown(),
}, /*END PLAN MODIFIERS*/
}, /*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.",
Optional: true,
Computed: true,
Validators: []validator.String{ /*START VALIDATORS*/
stringvalidator.LengthBetween(1, 256),
}, /*END VALIDATORS*/
PlanModifiers: []planmodifier.String{ /*START PLAN MODIFIERS*/
stringplanmodifier.UseStateForUnknown(),
}, /*END PLAN MODIFIERS*/
}, /*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.",
Optional: true,
Computed: true,
Validators: []validator.String{ /*START VALIDATORS*/
stringvalidator.LengthBetween(1, 256),
}, /*END VALIDATORS*/
PlanModifiers: []planmodifier.String{ /*START PLAN MODIFIERS*/
stringplanmodifier.UseStateForUnknown(),
}, /*END PLAN MODIFIERS*/
}, /*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.",
Optional: true,
Computed: true,
Validators: []validator.String{ /*START VALIDATORS*/
stringvalidator.LengthBetween(1, 256),
}, /*END VALIDATORS*/
PlanModifiers: []planmodifier.String{ /*START PLAN MODIFIERS*/
stringplanmodifier.UseStateForUnknown(),
}, /*END PLAN MODIFIERS*/
}, /*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.",
Optional: true,
Computed: true,
Validators: []validator.String{ /*START VALIDATORS*/
stringvalidator.LengthBetween(1, 256),
}, /*END VALIDATORS*/
PlanModifiers: []planmodifier.String{ /*START PLAN MODIFIERS*/
stringplanmodifier.UseStateForUnknown(),
}, /*END PLAN MODIFIERS*/
}, /*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.",
Optional: true,
Computed: true,
Validators: []validator.String{ /*START VALIDATORS*/
stringvalidator.LengthBetween(1, 256),
}, /*END VALIDATORS*/
PlanModifiers: []planmodifier.String{ /*START PLAN MODIFIERS*/
stringplanmodifier.UseStateForUnknown(),
}, /*END PLAN MODIFIERS*/
}, /*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.",
Optional: true,
Computed: true,
Validators: []validator.String{ /*START VALIDATORS*/
stringvalidator.LengthBetween(1, 256),
}, /*END VALIDATORS*/
PlanModifiers: []planmodifier.String{ /*START PLAN MODIFIERS*/
stringplanmodifier.UseStateForUnknown(),
}, /*END PLAN MODIFIERS*/
}, /*END ATTRIBUTE*/
}, /*END SCHEMA*/
Description: "Maps Grafana friendly names to the IdPs SAML attributes.",
Optional: true,
Computed: true,
PlanModifiers: []planmodifier.Object{ /*START PLAN MODIFIERS*/
objectplanmodifier.UseStateForUnknown(),
}, /*END PLAN MODIFIERS*/
}, /*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.",
Optional: true,
Computed: true,
Validators: []validator.String{ /*START VALIDATORS*/
stringvalidator.LengthBetween(1, 2048),
}, /*END VALIDATORS*/
PlanModifiers: []planmodifier.String{ /*START PLAN MODIFIERS*/
stringplanmodifier.UseStateForUnknown(),
}, /*END PLAN MODIFIERS*/
}, /*END ATTRIBUTE*/
// Property: Xml
"xml": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "XML blob of the IdPs metadata.",
Optional: true,
Computed: true,
PlanModifiers: []planmodifier.String{ /*START PLAN MODIFIERS*/
stringplanmodifier.UseStateForUnknown(),
}, /*END PLAN MODIFIERS*/
}, /*END ATTRIBUTE*/
}, /*END SCHEMA*/
Description: "IdP Metadata used to configure SAML authentication in Grafana.",
Required: 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.",
Optional: true,
Computed: true,
PlanModifiers: []planmodifier.Float64{ /*START PLAN MODIFIERS*/
float64planmodifier.UseStateForUnknown(),
}, /*END PLAN MODIFIERS*/
}, /*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.",
Optional: true,
Computed: true,
Validators: []validator.List{ /*START VALIDATORS*/
listvalidator.ValueStringsAre(
stringvalidator.LengthBetween(1, 256),
),
}, /*END VALIDATORS*/
PlanModifiers: []planmodifier.List{ /*START PLAN MODIFIERS*/
generic.Multiset(),
listplanmodifier.UseStateForUnknown(),
}, /*END PLAN MODIFIERS*/
}, /*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.",
Optional: true,
Computed: true,
Validators: []validator.List{ /*START VALIDATORS*/
listvalidator.ValueStringsAre(
stringvalidator.LengthBetween(1, 256),
),
}, /*END VALIDATORS*/
PlanModifiers: []planmodifier.List{ /*START PLAN MODIFIERS*/
generic.Multiset(),
listplanmodifier.UseStateForUnknown(),
}, /*END PLAN MODIFIERS*/
}, /*END ATTRIBUTE*/
}, /*END SCHEMA*/
Description: "Maps SAML roles to the Grafana Editor and Admin roles.",
Optional: true,
Computed: true,
PlanModifiers: []planmodifier.Object{ /*START PLAN MODIFIERS*/
objectplanmodifier.UseStateForUnknown(),
}, /*END PLAN MODIFIERS*/
}, /*END ATTRIBUTE*/
}, /*END SCHEMA*/
Description: "SAML configuration data associated with an AMG workspace.",
Optional: true,
Computed: true,
PlanModifiers: []planmodifier.Object{ /*START PLAN MODIFIERS*/
objectplanmodifier.UseStateForUnknown(),
}, /*END PLAN MODIFIERS*/
}, /*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,
PlanModifiers: []planmodifier.String{ /*START PLAN MODIFIERS*/
stringplanmodifier.UseStateForUnknown(),
}, /*END PLAN MODIFIERS*/
}, /*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,
PlanModifiers: []planmodifier.String{ /*START PLAN MODIFIERS*/
stringplanmodifier.UseStateForUnknown(),
}, /*END PLAN MODIFIERS*/
}, /*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.",
Optional: true,
Computed: true,
PlanModifiers: []planmodifier.String{ /*START PLAN MODIFIERS*/
stringplanmodifier.UseStateForUnknown(),
}, /*END PLAN MODIFIERS*/
}, /*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,
PlanModifiers: []planmodifier.String{ /*START PLAN MODIFIERS*/
stringplanmodifier.UseStateForUnknown(),
}, /*END PLAN MODIFIERS*/
}, /*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.",
Required: true,
Validators: []validator.Set{ /*START VALIDATORS*/
setvalidator.SizeBetween(1, 5),
setvalidator.ValueStringsAre(
stringvalidator.LengthBetween(1, 255),
),
}, /*END VALIDATORS*/
}, /*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.",
Required: true,
Validators: []validator.Set{ /*START VALIDATORS*/
setvalidator.SizeBetween(2, 6),
setvalidator.ValueStringsAre(
stringvalidator.LengthBetween(1, 255),
),
}, /*END VALIDATORS*/
}, /*END ATTRIBUTE*/
}, /*END SCHEMA*/
Description: "The configuration settings for an Amazon VPC that contains data sources for your Grafana workspace to connect to.",
Optional: true,
Computed: true,
PlanModifiers: []planmodifier.Object{ /*START PLAN MODIFIERS*/
objectplanmodifier.UseStateForUnknown(),
}, /*END PLAN MODIFIERS*/
}, /*END ATTRIBUTE*/
} /*END SCHEMA*/
// Corresponds to CloudFormation primaryIdentifier.
attributes["id"] = schema.StringAttribute{
Description: "Uniquely identifies the resource.",
Computed: true,
PlanModifiers: []planmodifier.String{
stringplanmodifier.UseStateForUnknown(),
},
}
schema := schema.Schema{
Description: "Definition of AWS::Grafana::Workspace Resource Type",
Version: 1,
Attributes: attributes,
}
var opts generic.ResourceOptions
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",