-
Notifications
You must be signed in to change notification settings - Fork 658
/
resource_ibm_cm_version.go
3406 lines (3306 loc) · 118 KB
/
resource_ibm_cm_version.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 IBM Corp. 2022 All Rights Reserved.
// Licensed under the Mozilla Public License v2.0
package catalogmanagement
import (
"context"
"encoding/json"
"fmt"
"log"
"strconv"
"strings"
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns"
"github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex"
"github.com/IBM/go-sdk-core/v5/core"
"github.com/IBM/platform-services-go-sdk/catalogmanagementv1"
)
func ResourceIBMCmVersion() *schema.Resource {
return &schema.Resource{
CreateContext: resourceIBMCmVersionCreate,
ReadContext: resourceIBMCmVersionRead,
UpdateContext: resourceIBMCmVersionUpdate,
DeleteContext: resourceIBMCmVersionDelete,
Importer: &schema.ResourceImporter{},
Schema: map[string]*schema.Schema{
"catalog_id": &schema.Schema{
Type: schema.TypeString,
Required: true,
ForceNew: true,
Description: "Catalog identifier.",
},
"offering_id": &schema.Schema{
Type: schema.TypeString,
Required: true,
ForceNew: true,
Description: "Offering identification.",
},
"tags": &schema.Schema{
Type: schema.TypeList,
Optional: true,
Description: "Tags array.",
Elem: &schema.Schema{Type: schema.TypeString},
},
"content": &schema.Schema{
Type: schema.TypeString,
Optional: true,
ForceNew: true,
Description: "Byte array representing the content to be imported. Only supported for OVA images at this time.",
},
"name": &schema.Schema{
Type: schema.TypeString,
Optional: true,
ForceNew: true,
Description: "Name of version. Required for virtual server image for VPC.",
},
"label": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Description: "Display name of version. Required for virtual server image for VPC.",
},
"deprecate": &schema.Schema{
Type: schema.TypeBool,
Optional: true,
Description: "Deprecate this version.",
},
"install_kind": &schema.Schema{
Type: schema.TypeString,
Optional: true,
ForceNew: true,
Description: "Install type. Example: instance. Required for virtual server image for VPC.",
},
"target_kinds": &schema.Schema{
Type: schema.TypeList,
Optional: true,
ForceNew: true,
Description: "Deployment target of the content being onboarded. Current valid values are iks, roks, vcenter, power-iaas, terraform, and vpc-x86. Required for virtual server image for VPC.",
Elem: &schema.Schema{Type: schema.TypeString},
},
"format_kind": &schema.Schema{
Type: schema.TypeString,
Optional: true,
ForceNew: true,
Description: "Format of content being onboarded. Example: vsi-image. Required for virtual server image for VPC.",
},
"product_kind": &schema.Schema{
Type: schema.TypeString,
Optional: true,
ForceNew: true,
Description: "Optional product kind for the software being onboarded. Valid values are software, module, or solution. Default value is software.",
},
"import_sha": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Description: "SHA256 fingerprint of the image file. Required for virtual server image for VPC.",
},
"sha": &schema.Schema{
Type: schema.TypeString,
Computed: true,
Description: "SHA256 fingerprint of the image file. Required for virtual server image for VPC.",
},
"version": &schema.Schema{
Type: schema.TypeString,
Computed: true,
Description: "Semantic version of the software being onboarded. Required for virtual server image for VPC.",
},
"usage": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Description: "The usage text for this version.",
},
"terraform_version": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Description: "Provide a terraform version for this offering version to use.",
},
"flavor": &schema.Schema{
Type: schema.TypeList,
MaxItems: 1,
Optional: true,
Description: "Version Flavor Information. Only supported for Product kind Solution.",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"name": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Description: "Programmatic name for this flavor.",
},
"label": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Description: "Label for this flavor.",
},
"label_i18n": &schema.Schema{
Type: schema.TypeMap,
Optional: true,
Description: "A map of translated strings, by language code.",
Elem: &schema.Schema{Type: schema.TypeString},
},
"index": &schema.Schema{
Type: schema.TypeInt,
Optional: true,
Description: "Order that this flavor should appear when listed for a single version.",
},
},
},
},
"import_metadata": &schema.Schema{
Type: schema.TypeList,
MaxItems: 1,
Optional: true,
Description: "Generic data to be included with content being onboarded. Required for virtual server image for VPC.",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"operating_system": &schema.Schema{
Type: schema.TypeList,
MaxItems: 1,
Optional: true,
Description: "Operating system included in this image. Required for virtual server image for VPC.",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"dedicated_host_only": &schema.Schema{
Type: schema.TypeBool,
Optional: true,
Description: "Images with this operating system can only be used on dedicated hosts or dedicated host groups. Required for virtual server image for VPC.",
},
"vendor": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Description: "Vendor of the operating system. Required for virtual server image for VPC.",
},
"name": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Description: "Globally unique name for this operating system Required for virtual server image for VPC.",
},
"href": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Description: "URL for this operating system. Required for virtual server image for VPC.",
},
"display_name": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Description: "Unique, display-friendly name for the operating system. Required for virtual server image for VPC.",
},
"family": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Description: "Software family for this operating system. Required for virtual server image for VPC.",
},
"version": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Description: "Major release version of this operating system. Required for virtual server image for VPC.",
},
"architecture": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Description: "Operating system architecture. Required for virtual server image for VPC.",
},
},
},
},
"file": &schema.Schema{
Type: schema.TypeList,
MaxItems: 1,
Optional: true,
Description: "Details for the stored image file. Required for virtual server image for VPC.",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"size": &schema.Schema{
Type: schema.TypeInt,
Optional: true,
Description: "Size of the stored image file rounded up to the next gigabyte. Required for virtual server image for VPC.",
},
},
},
},
"minimum_provisioned_size": &schema.Schema{
Type: schema.TypeInt,
Optional: true,
Description: "Minimum size (in gigabytes) of a volume onto which this image may be provisioned. Required for virtual server image for VPC.",
},
"images": &schema.Schema{
Type: schema.TypeList,
Optional: true,
Description: "Image operating system. Required for virtual server image for VPC.",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"id": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Description: "Programmatic ID of virtual server image. Required for virtual server image for VPC.",
},
"name": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Description: "Programmatic name of virtual server image. Required for virtual server image for VPC.",
},
"region": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Description: "Region the virtual server image is available in. Required for virtual server image for VPC.",
},
},
},
},
},
},
},
"metadata": &schema.Schema{
Type: schema.TypeList,
Computed: true,
Description: "Generic data to be included with content being onboarded. Required for virtual server image for VPC.",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"source_url": &schema.Schema{
Type: schema.TypeString,
Computed: true,
Description: "Version source URL.",
},
"working_directory": &schema.Schema{
Type: schema.TypeString,
Computed: true,
Description: "Working directory of source files.",
},
"example_name": &schema.Schema{
Type: schema.TypeString,
Computed: true,
Description: "Working directory of source files.",
},
"start_deploy_time": &schema.Schema{
Type: schema.TypeString,
Computed: true,
Description: "The time validation started.",
},
"end_deploy_time": &schema.Schema{
Type: schema.TypeString,
Computed: true,
Description: "The time validation ended.",
},
"est_deploy_time": &schema.Schema{
Type: schema.TypeFloat,
Computed: true,
Description: "The estimated time validation takes.",
},
"usage": &schema.Schema{
Type: schema.TypeString,
Computed: true,
Description: "Usage text for the version.",
},
"usage_template": &schema.Schema{
Type: schema.TypeString,
Computed: true,
Description: "Usage text for the version.",
},
"modules": &schema.Schema{
Type: schema.TypeList,
Computed: true,
Description: "Terraform modules.",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"name": &schema.Schema{
Type: schema.TypeString,
Computed: true,
Description: "Name of the module.",
},
"source": &schema.Schema{
Type: schema.TypeString,
Computed: true,
Description: "Source of the module.",
},
"offering_reference": &schema.Schema{
Type: schema.TypeList,
Computed: true,
Description: "Terraform modules.",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"name": &schema.Schema{
Type: schema.TypeString,
Computed: true,
Description: "Name of the offering module.",
},
"id": &schema.Schema{
Type: schema.TypeString,
Computed: true,
Description: "ID of the offering module.",
},
"kind": &schema.Schema{
Type: schema.TypeString,
Computed: true,
Description: "Kind of the offeringmodule.",
},
"version": &schema.Schema{
Type: schema.TypeString,
Computed: true,
Description: "Version of the offering module.",
},
"flavor": &schema.Schema{
Type: schema.TypeString,
Computed: true,
Description: "Flavor of the module.",
},
"flavors": &schema.Schema{
Type: schema.TypeList,
Computed: true,
Description: "Flavors of the module.",
Elem: &schema.Schema{Type: schema.TypeString},
},
"catalog_id": &schema.Schema{
Type: schema.TypeString,
Computed: true,
Description: "Catalog ID of the module reference.",
},
"metadata": &schema.Schema{
Type: schema.TypeString,
Computed: true,
Description: "Metadata of the module.",
},
},
},
},
},
},
},
"version_name": &schema.Schema{
Type: schema.TypeString,
Computed: true,
Description: "Version name.",
},
"terraform_version": &schema.Schema{
Type: schema.TypeString,
Computed: true,
Description: "Terraform version.",
},
"validated_terraform_version": &schema.Schema{
Type: schema.TypeString,
Computed: true,
Description: "Validated terraform version.",
},
"vsi_vpc": &schema.Schema{
Type: schema.TypeList,
Computed: true,
Description: "VSI VPC version information",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"operating_system": &schema.Schema{
Type: schema.TypeList,
Computed: true,
Description: "Operating system included in this image. Required for virtual server image for VPC.",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"dedicated_host_only": &schema.Schema{
Type: schema.TypeBool,
Computed: true,
Description: "Images with this operating system can only be used on dedicated hosts or dedicated host groups. Required for virtual server image for VPC.",
},
"vendor": &schema.Schema{
Type: schema.TypeString,
Computed: true,
Description: "Vendor of the operating system. Required for virtual server image for VPC.",
},
"name": &schema.Schema{
Type: schema.TypeString,
Computed: true,
Description: "Globally unique name for this operating system Required for virtual server image for VPC.",
},
"href": &schema.Schema{
Type: schema.TypeString,
Computed: true,
Description: "URL for this operating system. Required for virtual server image for VPC.",
},
"display_name": &schema.Schema{
Type: schema.TypeString,
Computed: true,
Description: "Unique, display-friendly name for the operating system. Required for virtual server image for VPC.",
},
"family": &schema.Schema{
Type: schema.TypeString,
Computed: true,
Description: "Software family for this operating system. Required for virtual server image for VPC.",
},
"version": &schema.Schema{
Type: schema.TypeString,
Computed: true,
Description: "Major release version of this operating system. Required for virtual server image for VPC.",
},
"architecture": &schema.Schema{
Type: schema.TypeString,
Computed: true,
Description: "Operating system architecture. Required for virtual server image for VPC.",
},
},
},
},
"file": &schema.Schema{
Type: schema.TypeList,
Computed: true,
Description: "Details for the stored image file. Required for virtual server image for VPC.",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"size": &schema.Schema{
Type: schema.TypeInt,
Computed: true,
Description: "Size of the stored image file rounded up to the next gigabyte. Required for virtual server image for VPC.",
},
},
},
},
"minimum_provisioned_size": &schema.Schema{
Type: schema.TypeInt,
Computed: true,
Description: "Minimum size (in gigabytes) of a volume onto which this image may be provisioned. Required for virtual server image for VPC.",
},
"images": &schema.Schema{
Type: schema.TypeList,
Computed: true,
Description: "Image operating system. Required for virtual server image for VPC.",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"id": &schema.Schema{
Type: schema.TypeString,
Computed: true,
Description: "Programmatic ID of virtual server image. Required for virtual server image for VPC.",
},
"name": &schema.Schema{
Type: schema.TypeString,
Computed: true,
Description: "Programmatic name of virtual server image. Required for virtual server image for VPC.",
},
"region": &schema.Schema{
Type: schema.TypeString,
Computed: true,
Description: "Region the virtual server image is available in. Required for virtual server image for VPC.",
},
},
},
},
},
},
},
},
},
},
"working_directory": &schema.Schema{
Type: schema.TypeString,
Optional: true,
ForceNew: true,
Description: "Optional - The sub-folder within the specified tgz file that contains the software being onboarded.",
},
"zipurl": &schema.Schema{
Type: schema.TypeString,
Optional: true,
ForceNew: true,
Description: "URL path to zip location. If not specified, must provide content in the body of this call.",
},
"target_version": &schema.Schema{
Type: schema.TypeString,
Optional: true,
ForceNew: true,
Description: "The semver value for this new version, if not found in the zip url package content.",
},
"include_config": &schema.Schema{
Type: schema.TypeBool,
Optional: true,
ForceNew: true,
Description: "Add all possible configuration values to this version when importing.",
},
"is_vsi": &schema.Schema{
Type: schema.TypeBool,
Optional: true,
ForceNew: true,
Description: "Indicates that the current terraform template is used to install a virtual server image.",
},
"repotype": &schema.Schema{
Type: schema.TypeString,
Optional: true,
ForceNew: true,
Description: "The type of repository containing this version. Valid values are 'public_git' or 'enterprise_git'.",
},
"x_auth_token": &schema.Schema{
Type: schema.TypeString,
Optional: true,
ForceNew: true,
Sensitive: true,
Description: "Authentication token used to access the specified zip file.",
},
"rev": &schema.Schema{
Type: schema.TypeString,
Computed: true,
Description: "Cloudant revision.",
},
"crn": &schema.Schema{
Type: schema.TypeString,
Computed: true,
Description: "Version's CRN.",
},
"created": &schema.Schema{
Type: schema.TypeString,
Computed: true,
Description: "The date and time this version was created.",
},
"updated": &schema.Schema{
Type: schema.TypeString,
Computed: true,
Description: "The date and time this version was last updated.",
},
"kind_id": &schema.Schema{
Type: schema.TypeString,
Computed: true,
Description: "Kind ID.",
},
"repo_url": &schema.Schema{
Type: schema.TypeString,
Computed: true,
Description: "Content's repo URL.",
},
"source_url": &schema.Schema{
Type: schema.TypeString,
Computed: true,
Description: "Content's source URL (e.g git repo).",
},
"tgz_url": &schema.Schema{
Type: schema.TypeString,
Computed: true,
Description: "File used to on-board this version.",
},
"configuration": &schema.Schema{
Type: schema.TypeList,
Optional: true,
Computed: true,
ConfigMode: schema.SchemaConfigModeAttr,
Description: "List of user solicited overrides.",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"key": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Computed: true,
Description: "Configuration key.",
},
"type": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Computed: true,
Description: "Value type (string, boolean, int).",
},
"default_value": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Computed: true,
Description: "The default value as a JSON encoded string. To use a secret when the type is password, specify a JSON encoded value of $ref:#/components/schemas/SecretInstance, prefixed with `cmsm_v1:`.",
},
"display_name": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Computed: true,
Description: "Display name for configuration type.",
},
"value_constraint": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Computed: true,
Description: "Constraint associated with value, e.g., for string type - regx:[a-z].",
},
"description": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Computed: true,
Description: "Key description.",
},
"required": &schema.Schema{
Type: schema.TypeBool,
Optional: true,
Computed: true,
Description: "Is key required to install.",
},
"options": &schema.Schema{
Type: schema.TypeList,
Optional: true,
Computed: true,
Description: "List of options of type.",
Elem: &schema.Schema{Type: schema.TypeMap},
},
"hidden": &schema.Schema{
Type: schema.TypeBool,
Optional: true,
Computed: true,
Description: "Hide values.",
},
"custom_config": &schema.Schema{
Type: schema.TypeList,
MaxItems: 1,
Optional: true,
Computed: true,
ConfigMode: schema.SchemaConfigModeAttr,
Description: "Render type.",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"type": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Computed: true,
Description: "ID of the widget type.",
},
"grouping": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Computed: true,
Description: "Determines where this configuration type is rendered (3 sections today - Target, Resource, and Deployment).",
},
"original_grouping": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Computed: true,
Description: "Original grouping type for this configuration (3 types - Target, Resource, and Deployment).",
},
"grouping_index": &schema.Schema{
Type: schema.TypeInt,
Optional: true,
Computed: true,
Description: "Determines the order that this configuration item shows in that particular grouping.",
},
"config_constraints": &schema.Schema{
Type: schema.TypeMap,
Optional: true,
Computed: true,
Description: "Map of constraint parameters that will be passed to the custom widget.",
Elem: &schema.Schema{Type: schema.TypeString},
},
"associations": &schema.Schema{
Type: schema.TypeList,
MaxItems: 1,
Optional: true,
Computed: true,
ConfigMode: schema.SchemaConfigModeAttr,
Description: "List of parameters that are associated with this configuration.",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"parameters": &schema.Schema{
Type: schema.TypeList,
Optional: true,
Computed: true,
ConfigMode: schema.SchemaConfigModeAttr,
Description: "Parameters for this association.",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"name": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Computed: true,
Description: "Name of this parameter.",
},
"options_refresh": &schema.Schema{
Type: schema.TypeBool,
Optional: true,
Computed: true,
Description: "Refresh options.",
},
},
},
},
},
},
},
},
},
},
"type_metadata": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Computed: true,
Description: "The original type, as found in the source being onboarded.",
},
},
},
},
"outputs": &schema.Schema{
Type: schema.TypeList,
Computed: true,
Description: "List of output values for this version.",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"key": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Description: "Output key.",
},
"description": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Description: "Output description.",
},
},
},
},
"iam_permissions": &schema.Schema{
Type: schema.TypeList,
Optional: true,
Description: "List of IAM permissions that are required to consume this version.",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"service_name": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Description: "Service name.",
},
"role_crns": &schema.Schema{
Type: schema.TypeList,
Optional: true,
Description: "Role CRNs for this permission.",
Elem: &schema.Schema{Type: schema.TypeString},
},
"resources": &schema.Schema{
Type: schema.TypeList,
Optional: true,
Description: "Resources for this permission.",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"name": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Description: "Resource name.",
},
"description": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Description: "Resource description.",
},
"role_crns": &schema.Schema{
Type: schema.TypeList,
Optional: true,
Description: "Role CRNs for this permission.",
Elem: &schema.Schema{Type: schema.TypeString},
},
},
},
},
},
},
},
"validation": &schema.Schema{
Type: schema.TypeList,
Computed: true,
Description: "Validation response.",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"validated": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Description: "Date and time of last successful validation.",
},
"requested": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Description: "Date and time of last validation was requested.",
},
"state": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Description: "Current validation state - <empty>, in_progress, valid, invalid, expired.",
},
"last_operation": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Description: "Last operation (e.g. submit_deployment, generate_installer, install_offering.",
},
"target": &schema.Schema{
Type: schema.TypeMap,
Optional: true,
Description: "Validation target information (e.g. cluster_id, region, namespace, etc). Values will vary by Content type.",
Elem: &schema.Schema{Type: schema.TypeString},
},
"message": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Description: "Any message needing to be conveyed as part of the validation job.",
},
},
},
},
"required_resources": &schema.Schema{
Type: schema.TypeList,
Computed: true,
Description: "Resource requirments for installation.",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"type": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Description: "Type of requirement.",
},
"value": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Description: "mem, disk, cores, and nodes can be parsed as an int. targetVersion will be a semver range value.",
},
},
},
},
"single_instance": &schema.Schema{
Type: schema.TypeBool,
Computed: true,
Description: "Denotes if single instance can be deployed to a given cluster.",
},
"install": &schema.Schema{
Type: schema.TypeList,
Optional: true,
Computed: true,
MaxItems: 1,
Description: "Script information.",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"instructions": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Computed: true,
Description: "Instruction on step and by whom (role) that are needed to take place to prepare the target for installing this version.",
},
"instructions_i18n": &schema.Schema{
Type: schema.TypeMap,
Optional: true,
Computed: true,
Description: "A map of translated strings, by language code.",
Elem: &schema.Schema{Type: schema.TypeString},
},
"script": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Computed: true,
Description: "Optional script that needs to be run post any pre-condition script.",
},
"script_permission": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Computed: true,
Description: "Optional iam permissions that are required on the target cluster to run this script.",
},
"delete_script": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Computed: true,
Description: "Optional script that if run will remove the installed version.",
},
"scope": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Computed: true,
Description: "Optional value indicating if this script is scoped to a namespace or the entire cluster.",
},
},
},
},
"pre_install": &schema.Schema{
Type: schema.TypeList,
Optional: true,
Description: "Optional pre-install instructions.",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"instructions": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Description: "Instruction on step and by whom (role) that are needed to take place to prepare the target for installing this version.",
},
"instructions_i18n": &schema.Schema{
Type: schema.TypeMap,
Optional: true,
Description: "A map of translated strings, by language code.",
Elem: &schema.Schema{Type: schema.TypeString},
},
"script": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Description: "Optional script that needs to be run post any pre-condition script.",
},
"script_permission": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Description: "Optional iam permissions that are required on the target cluster to run this script.",
},
"delete_script": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Description: "Optional script that if run will remove the installed version.",
},
"scope": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Description: "Optional value indicating if this script is scoped to a namespace or the entire cluster.",
},
},
},
},
"entitlement": &schema.Schema{
Type: schema.TypeList,
Computed: true,
Description: "Entitlement license info.",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"provider_name": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Description: "Provider name.",
},
"provider_id": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Description: "Provider ID.",
},
"product_id": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Description: "Product ID.",
},
"part_numbers": &schema.Schema{
Type: schema.TypeList,
Optional: true,
Description: "list of license entitlement part numbers, eg. D1YGZLL,D1ZXILL.",
Elem: &schema.Schema{Type: schema.TypeString},
},
"image_repo_name": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Description: "Image repository name.",
},
},
},
},
"licenses": &schema.Schema{
Type: schema.TypeList,
Optional: true,
Computed: true,
Description: "List of licenses the product was built with.",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"id": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Computed: true,
Description: "License ID.",
},
"name": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Computed: true,
Description: "license name.",
},
"type": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Computed: true,
Description: "type of license e.g., Apache xxx.",
},
"url": &schema.Schema{