-
Notifications
You must be signed in to change notification settings - Fork 19
/
1.8.0.go
1358 lines (1356 loc) · 38.3 KB
/
1.8.0.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
// Code generated by "gen"; DO NOT EDIT.
package funcs
import (
"github.com/hashicorp/hcl-lang/schema"
"github.com/zclconf/go-cty/cty"
"github.com/zclconf/go-cty/cty/function"
)
func v1_8_0_Functions() map[string]schema.FunctionSignature {
return map[string]schema.FunctionSignature{
"abs": {
Params: []function.Parameter{
{
Name: "num",
Type: cty.Number,
},
},
ReturnType: cty.Number,
Description: "`abs` returns the absolute value of the given number. In other words, if the number is zero or positive then it is returned as-is, but if it is negative then it is multiplied by -1 to make it positive before returning it.",
},
"abspath": {
Params: []function.Parameter{
{
Name: "path",
Type: cty.String,
},
},
ReturnType: cty.String,
Description: "`abspath` takes a string containing a filesystem path and converts it to an absolute path. That is, if the path is not absolute, it will be joined with the current working directory.",
},
"alltrue": {
Params: []function.Parameter{
{
Name: "list",
Type: cty.List(cty.Bool),
},
},
ReturnType: cty.Bool,
Description: "`alltrue` returns `true` if all elements in a given collection are `true` or `\"true\"`. It also returns `true` if the collection is empty.",
},
"anytrue": {
Params: []function.Parameter{
{
Name: "list",
Type: cty.List(cty.Bool),
},
},
ReturnType: cty.Bool,
Description: "`anytrue` returns `true` if any element in a given collection is `true` or `\"true\"`. It also returns `false` if the collection is empty.",
},
"base64decode": {
Params: []function.Parameter{
{
Name: "str",
Type: cty.String,
},
},
ReturnType: cty.String,
Description: "`base64decode` takes a string containing a Base64 character sequence and returns the original string.",
},
"base64encode": {
Params: []function.Parameter{
{
Name: "str",
Type: cty.String,
},
},
ReturnType: cty.String,
Description: "`base64encode` applies Base64 encoding to a string.",
},
"base64gzip": {
Params: []function.Parameter{
{
Name: "str",
Type: cty.String,
},
},
ReturnType: cty.String,
Description: "`base64gzip` compresses a string with gzip and then encodes the result in Base64 encoding.",
},
"base64sha256": {
Params: []function.Parameter{
{
Name: "str",
Type: cty.String,
},
},
ReturnType: cty.String,
Description: "`base64sha256` computes the SHA256 hash of a given string and encodes it with Base64. This is not equivalent to `base64encode(sha256(\"test\"))` since `sha256()` returns hexadecimal representation.",
},
"base64sha512": {
Params: []function.Parameter{
{
Name: "str",
Type: cty.String,
},
},
ReturnType: cty.String,
Description: "`base64sha512` computes the SHA512 hash of a given string and encodes it with Base64. This is not equivalent to `base64encode(sha512(\"test\"))` since `sha512()` returns hexadecimal representation.",
},
"basename": {
Params: []function.Parameter{
{
Name: "path",
Type: cty.String,
},
},
ReturnType: cty.String,
Description: "`basename` takes a string containing a filesystem path and removes all except the last portion from it.",
},
"bcrypt": {
Params: []function.Parameter{
{
Name: "str",
Type: cty.String,
},
},
VarParam: &function.Parameter{
Name: "cost",
Description: "The `cost` argument is optional and will default to 10 if unspecified.",
Type: cty.Number,
},
ReturnType: cty.String,
Description: "`bcrypt` computes a hash of the given string using the Blowfish cipher, returning a string in [the _Modular Crypt Format_](https://passlib.readthedocs.io/en/stable/modular_crypt_format.html) usually expected in the shadow password file on many Unix systems.",
},
"can": {
Params: []function.Parameter{
{
Name: "expression",
Type: cty.DynamicPseudoType,
},
},
ReturnType: cty.Bool,
Description: "`can` evaluates the given expression and returns a boolean value indicating whether the expression produced a result without any errors.",
},
"ceil": {
Params: []function.Parameter{
{
Name: "num",
Type: cty.Number,
},
},
ReturnType: cty.Number,
Description: "`ceil` returns the closest whole number that is greater than or equal to the given value, which may be a fraction.",
},
"chomp": {
Params: []function.Parameter{
{
Name: "str",
Type: cty.String,
},
},
ReturnType: cty.String,
Description: "`chomp` removes newline characters at the end of a string.",
},
"chunklist": {
Params: []function.Parameter{
{
Name: "list",
Type: cty.List(cty.DynamicPseudoType),
},
{
Name: "size",
Description: "The maximum length of each chunk. All but the last element of the result is guaranteed to be of exactly this size.",
Type: cty.Number,
},
},
ReturnType: cty.List(cty.List(cty.DynamicPseudoType)),
Description: "`chunklist` splits a single list into fixed-size chunks, returning a list of lists.",
},
"cidrhost": {
Params: []function.Parameter{
{
Name: "prefix",
Description: "`prefix` must be given in CIDR notation, as defined in [RFC 4632 section 3.1](https://tools.ietf.org/html/rfc4632#section-3.1).",
Type: cty.String,
},
{
Name: "hostnum",
Description: "`hostnum` is a whole number that can be represented as a binary integer with no more than the number of digits remaining in the address after the given prefix.",
Type: cty.Number,
},
},
ReturnType: cty.String,
Description: "`cidrhost` calculates a full host IP address for a given host number within a given IP network address prefix.",
},
"cidrnetmask": {
Params: []function.Parameter{
{
Name: "prefix",
Description: "`prefix` must be given in CIDR notation, as defined in [RFC 4632 section 3.1](https://tools.ietf.org/html/rfc4632#section-3.1).",
Type: cty.String,
},
},
ReturnType: cty.String,
Description: "`cidrnetmask` converts an IPv4 address prefix given in CIDR notation into a subnet mask address.",
},
"cidrsubnet": {
Params: []function.Parameter{
{
Name: "prefix",
Description: "`prefix` must be given in CIDR notation, as defined in [RFC 4632 section 3.1](https://tools.ietf.org/html/rfc4632#section-3.1).",
Type: cty.String,
},
{
Name: "newbits",
Description: "`newbits` is the number of additional bits with which to extend the prefix.",
Type: cty.Number,
},
{
Name: "netnum",
Description: "`netnum` is a whole number that can be represented as a binary integer with no more than `newbits` binary digits, which will be used to populate the additional bits added to the prefix.",
Type: cty.Number,
},
},
ReturnType: cty.String,
Description: "`cidrsubnet` calculates a subnet address within given IP network address prefix.",
},
"cidrsubnets": {
Params: []function.Parameter{
{
Name: "prefix",
Description: "`prefix` must be given in CIDR notation, as defined in [RFC 4632 section 3.1](https://tools.ietf.org/html/rfc4632#section-3.1).",
Type: cty.String,
},
},
VarParam: &function.Parameter{
Name: "newbits",
Description: "",
Type: cty.Number,
},
ReturnType: cty.List(cty.String),
Description: "`cidrsubnets` calculates a sequence of consecutive IP address ranges within a particular CIDR prefix.",
},
"coalesce": {
VarParam: &function.Parameter{
Name: "vals",
Description: "",
Type: cty.DynamicPseudoType,
},
ReturnType: cty.DynamicPseudoType,
Description: "`coalesce` takes any number of arguments and returns the first one that isn't null or an empty string.",
},
"coalescelist": {
VarParam: &function.Parameter{
Name: "vals",
Description: "List or tuple values to test in the given order.",
Type: cty.DynamicPseudoType,
},
ReturnType: cty.DynamicPseudoType,
Description: "`coalescelist` takes any number of list arguments and returns the first one that isn't empty.",
},
"compact": {
Params: []function.Parameter{
{
Name: "list",
Type: cty.List(cty.String),
},
},
ReturnType: cty.List(cty.String),
Description: "`compact` takes a list of strings and returns a new list with any empty string elements removed.",
},
"concat": {
VarParam: &function.Parameter{
Name: "seqs",
Description: "",
Type: cty.DynamicPseudoType,
},
ReturnType: cty.DynamicPseudoType,
Description: "`concat` takes two or more lists and combines them into a single list.",
},
"contains": {
Params: []function.Parameter{
{
Name: "list",
Type: cty.DynamicPseudoType,
},
{
Name: "value",
Type: cty.DynamicPseudoType,
},
},
ReturnType: cty.DynamicPseudoType,
Description: "`contains` determines whether a given list or set contains a given single value as one of its elements.",
},
"csvdecode": {
Params: []function.Parameter{
{
Name: "str",
Type: cty.String,
},
},
ReturnType: cty.DynamicPseudoType,
Description: "`csvdecode` decodes a string containing CSV-formatted data and produces a list of maps representing that data.",
},
"dirname": {
Params: []function.Parameter{
{
Name: "path",
Type: cty.String,
},
},
ReturnType: cty.String,
Description: "`dirname` takes a string containing a filesystem path and removes the last portion from it.",
},
"distinct": {
Params: []function.Parameter{
{
Name: "list",
Type: cty.List(cty.DynamicPseudoType),
},
},
ReturnType: cty.List(cty.DynamicPseudoType),
Description: "`distinct` takes a list and returns a new list with any duplicate elements removed.",
},
"element": {
Params: []function.Parameter{
{
Name: "list",
Type: cty.DynamicPseudoType,
},
{
Name: "index",
Type: cty.Number,
},
},
ReturnType: cty.DynamicPseudoType,
Description: "`element` retrieves a single element from a list.",
},
"endswith": {
Params: []function.Parameter{
{
Name: "str",
Type: cty.String,
},
{
Name: "suffix",
Type: cty.String,
},
},
ReturnType: cty.Bool,
Description: "`endswith` takes two values: a string to check and a suffix string. The function returns true if the first string ends with that exact suffix.",
},
"file": {
Params: []function.Parameter{
{
Name: "path",
Type: cty.String,
},
},
ReturnType: cty.String,
Description: "`file` reads the contents of a file at the given path and returns them as a string.",
},
"filebase64": {
Params: []function.Parameter{
{
Name: "path",
Type: cty.String,
},
},
ReturnType: cty.String,
Description: "`filebase64` reads the contents of a file at the given path and returns them as a base64-encoded string.",
},
"filebase64sha256": {
Params: []function.Parameter{
{
Name: "path",
Type: cty.String,
},
},
ReturnType: cty.String,
Description: "`filebase64sha256` is a variant of `base64sha256` that hashes the contents of a given file rather than a literal string.",
},
"filebase64sha512": {
Params: []function.Parameter{
{
Name: "path",
Type: cty.String,
},
},
ReturnType: cty.String,
Description: "`filebase64sha512` is a variant of `base64sha512` that hashes the contents of a given file rather than a literal string.",
},
"fileexists": {
Params: []function.Parameter{
{
Name: "path",
Type: cty.String,
},
},
ReturnType: cty.Bool,
Description: "`fileexists` determines whether a file exists at a given path.",
},
"filemd5": {
Params: []function.Parameter{
{
Name: "path",
Type: cty.String,
},
},
ReturnType: cty.String,
Description: "`filemd5` is a variant of `md5` that hashes the contents of a given file rather than a literal string.",
},
"fileset": {
Params: []function.Parameter{
{
Name: "path",
Type: cty.String,
},
{
Name: "pattern",
Type: cty.String,
},
},
ReturnType: cty.Set(cty.String),
Description: "`fileset` enumerates a set of regular file names given a path and pattern. The path is automatically removed from the resulting set of file names and any result still containing path separators always returns forward slash (`/`) as the path separator for cross-system compatibility.",
},
"filesha1": {
Params: []function.Parameter{
{
Name: "path",
Type: cty.String,
},
},
ReturnType: cty.String,
Description: "`filesha1` is a variant of `sha1` that hashes the contents of a given file rather than a literal string.",
},
"filesha256": {
Params: []function.Parameter{
{
Name: "path",
Type: cty.String,
},
},
ReturnType: cty.String,
Description: "`filesha256` is a variant of `sha256` that hashes the contents of a given file rather than a literal string.",
},
"filesha512": {
Params: []function.Parameter{
{
Name: "path",
Type: cty.String,
},
},
ReturnType: cty.String,
Description: "`filesha512` is a variant of `sha512` that hashes the contents of a given file rather than a literal string.",
},
"flatten": {
Params: []function.Parameter{
{
Name: "list",
Type: cty.DynamicPseudoType,
},
},
ReturnType: cty.DynamicPseudoType,
Description: "`flatten` takes a list and replaces any elements that are lists with a flattened sequence of the list contents.",
},
"floor": {
Params: []function.Parameter{
{
Name: "num",
Type: cty.Number,
},
},
ReturnType: cty.Number,
Description: "`floor` returns the closest whole number that is less than or equal to the given value, which may be a fraction.",
},
"format": {
Params: []function.Parameter{
{
Name: "format",
Type: cty.String,
},
},
VarParam: &function.Parameter{
Name: "args",
Description: "",
Type: cty.DynamicPseudoType,
},
ReturnType: cty.DynamicPseudoType,
Description: "The `format` function produces a string by formatting a number of other values according to a specification string. It is similar to the `printf` function in C, and other similar functions in other programming languages.",
},
"formatdate": {
Params: []function.Parameter{
{
Name: "format",
Type: cty.String,
},
{
Name: "time",
Type: cty.String,
},
},
ReturnType: cty.String,
Description: "`formatdate` converts a timestamp into a different time format.",
},
"formatlist": {
Params: []function.Parameter{
{
Name: "format",
Type: cty.String,
},
},
VarParam: &function.Parameter{
Name: "args",
Description: "",
Type: cty.DynamicPseudoType,
},
ReturnType: cty.DynamicPseudoType,
Description: "`formatlist` produces a list of strings by formatting a number of other values according to a specification string.",
},
"indent": {
Params: []function.Parameter{
{
Name: "spaces",
Description: "Number of spaces to add after each newline character.",
Type: cty.Number,
},
{
Name: "str",
Type: cty.String,
},
},
ReturnType: cty.String,
Description: "`indent` adds a given number of spaces to the beginnings of all but the first line in a given multi-line string.",
},
"index": {
Params: []function.Parameter{
{
Name: "list",
Type: cty.DynamicPseudoType,
},
{
Name: "value",
Type: cty.DynamicPseudoType,
},
},
ReturnType: cty.DynamicPseudoType,
Description: "`index` finds the element index for a given value in a list.",
},
"issensitive": {
Params: []function.Parameter{
{
Name: "value",
Type: cty.DynamicPseudoType,
},
},
ReturnType: cty.Bool,
Description: "`issensitive` takes a value and returns a boolean indicating if the value is sensitive.",
},
"join": {
Params: []function.Parameter{
{
Name: "separator",
Description: "Delimiter to insert between the given strings.",
Type: cty.String,
},
},
VarParam: &function.Parameter{
Name: "lists",
Description: "One or more lists of strings to join.",
Type: cty.List(cty.String),
},
ReturnType: cty.String,
Description: "`join` produces a string by concatenating together all elements of a given list of strings with the given delimiter.",
},
"jsondecode": {
Params: []function.Parameter{
{
Name: "str",
Type: cty.String,
},
},
ReturnType: cty.DynamicPseudoType,
Description: "`jsondecode` interprets a given string as JSON, returning a representation of the result of decoding that string.",
},
"jsonencode": {
Params: []function.Parameter{
{
Name: "val",
Type: cty.DynamicPseudoType,
},
},
ReturnType: cty.String,
Description: "`jsonencode` encodes a given value to a string using JSON syntax.",
},
"keys": {
Params: []function.Parameter{
{
Name: "inputMap",
Description: "The map to extract keys from. May instead be an object-typed value, in which case the result is a tuple of the object attributes.",
Type: cty.DynamicPseudoType,
},
},
ReturnType: cty.DynamicPseudoType,
Description: "`keys` takes a map and returns a list containing the keys from that map.",
},
"length": {
Params: []function.Parameter{
{
Name: "value",
Type: cty.DynamicPseudoType,
},
},
ReturnType: cty.Number,
Description: "`length` determines the length of a given list, map, or string.",
},
"log": {
Params: []function.Parameter{
{
Name: "num",
Type: cty.Number,
},
{
Name: "base",
Type: cty.Number,
},
},
ReturnType: cty.Number,
Description: "`log` returns the logarithm of a given number in a given base.",
},
"lookup": {
Params: []function.Parameter{
{
Name: "inputMap",
Type: cty.DynamicPseudoType,
},
{
Name: "key",
Type: cty.String,
},
},
VarParam: &function.Parameter{
Name: "default",
Description: "",
Type: cty.DynamicPseudoType,
},
ReturnType: cty.DynamicPseudoType,
Description: "`lookup` retrieves the value of a single element from a map, given its key. If the given key does not exist, the given default value is returned instead.",
},
"lower": {
Params: []function.Parameter{
{
Name: "str",
Type: cty.String,
},
},
ReturnType: cty.String,
Description: "`lower` converts all cased letters in the given string to lowercase.",
},
"matchkeys": {
Params: []function.Parameter{
{
Name: "values",
Type: cty.List(cty.DynamicPseudoType),
},
{
Name: "keys",
Type: cty.List(cty.DynamicPseudoType),
},
{
Name: "searchset",
Type: cty.List(cty.DynamicPseudoType),
},
},
ReturnType: cty.List(cty.DynamicPseudoType),
Description: "`matchkeys` constructs a new list by taking a subset of elements from one list whose indexes match the corresponding indexes of values in another list.",
},
"max": {
VarParam: &function.Parameter{
Name: "numbers",
Description: "",
Type: cty.Number,
},
ReturnType: cty.Number,
Description: "`max` takes one or more numbers and returns the greatest number from the set.",
},
"md5": {
Params: []function.Parameter{
{
Name: "str",
Type: cty.String,
},
},
ReturnType: cty.String,
Description: "`md5` computes the MD5 hash of a given string and encodes it with hexadecimal digits.",
},
"merge": {
VarParam: &function.Parameter{
Name: "maps",
Description: "",
Type: cty.DynamicPseudoType,
},
ReturnType: cty.DynamicPseudoType,
Description: "`merge` takes an arbitrary number of maps or objects, and returns a single map or object that contains a merged set of elements from all arguments.",
},
"min": {
VarParam: &function.Parameter{
Name: "numbers",
Description: "",
Type: cty.Number,
},
ReturnType: cty.Number,
Description: "`min` takes one or more numbers and returns the smallest number from the set.",
},
"nonsensitive": {
Params: []function.Parameter{
{
Name: "value",
Type: cty.DynamicPseudoType,
},
},
ReturnType: cty.DynamicPseudoType,
Description: "`nonsensitive` takes a sensitive value and returns a copy of that value with the sensitive marking removed, thereby exposing the sensitive value.",
},
"one": {
Params: []function.Parameter{
{
Name: "list",
Type: cty.DynamicPseudoType,
},
},
ReturnType: cty.DynamicPseudoType,
Description: "`one` takes a list, set, or tuple value with either zero or one elements. If the collection is empty, `one` returns `null`. Otherwise, `one` returns the first element. If there are two or more elements then `one` will return an error.",
},
"parseint": {
Params: []function.Parameter{
{
Name: "number",
Type: cty.DynamicPseudoType,
},
{
Name: "base",
Type: cty.Number,
},
},
ReturnType: cty.DynamicPseudoType,
Description: "`parseint` parses the given string as a representation of an integer in the specified base and returns the resulting number. The base must be between 2 and 62 inclusive.",
},
"pathexpand": {
Params: []function.Parameter{
{
Name: "path",
Type: cty.String,
},
},
ReturnType: cty.String,
Description: "`pathexpand` takes a filesystem path that might begin with a `~` segment, and if so it replaces that segment with the current user's home directory path.",
},
"plantimestamp": {
ReturnType: cty.String,
Description: "`plantimestamp` returns a UTC timestamp string in [RFC 3339](https://tools.ietf.org/html/rfc3339) format, fixed to a constant time representing the time of the plan.",
},
"pow": {
Params: []function.Parameter{
{
Name: "num",
Type: cty.Number,
},
{
Name: "power",
Type: cty.Number,
},
},
ReturnType: cty.Number,
Description: "`pow` calculates an exponent, by raising its first argument to the power of the second argument.",
},
"range": {
VarParam: &function.Parameter{
Name: "params",
Description: "",
Type: cty.Number,
},
ReturnType: cty.List(cty.Number),
Description: "`range` generates a list of numbers using a start value, a limit value, and a step value.",
},
"regex": {
Params: []function.Parameter{
{
Name: "pattern",
Type: cty.String,
},
{
Name: "string",
Type: cty.String,
},
},
ReturnType: cty.DynamicPseudoType,
Description: "`regex` applies a [regular expression](https://en.wikipedia.org/wiki/Regular_expression) to a string and returns the matching substrings.",
},
"regexall": {
Params: []function.Parameter{
{
Name: "pattern",
Type: cty.String,
},
{
Name: "string",
Type: cty.String,
},
},
ReturnType: cty.List(cty.DynamicPseudoType),
Description: "`regexall` applies a [regular expression](https://en.wikipedia.org/wiki/Regular_expression) to a string and returns a list of all matches.",
},
"replace": {
Params: []function.Parameter{
{
Name: "str",
Type: cty.String,
},
{
Name: "substr",
Type: cty.String,
},
{
Name: "replace",
Type: cty.String,
},
},
ReturnType: cty.String,
Description: "`replace` searches a given string for another given substring, and replaces each occurrence with a given replacement string.",
},
"reverse": {
Params: []function.Parameter{
{
Name: "list",
Type: cty.DynamicPseudoType,
},
},
ReturnType: cty.DynamicPseudoType,
Description: "`reverse` takes a sequence and produces a new sequence of the same length with all of the same elements as the given sequence but in reverse order.",
},
"rsadecrypt": {
Params: []function.Parameter{
{
Name: "ciphertext",
Type: cty.String,
},
{
Name: "privatekey",
Type: cty.String,
},
},
ReturnType: cty.String,
Description: "`rsadecrypt` decrypts an RSA-encrypted ciphertext, returning the corresponding cleartext.",
},
"sensitive": {
Params: []function.Parameter{
{
Name: "value",
Type: cty.DynamicPseudoType,
},
},
ReturnType: cty.DynamicPseudoType,
Description: "`sensitive` takes any value and returns a copy of it marked so that Terraform will treat it as sensitive, with the same meaning and behavior as for [sensitive input variables](/terraform/language/values/variables#suppressing-values-in-cli-output).",
},
"setintersection": {
Params: []function.Parameter{
{
Name: "first_set",
Type: cty.Set(cty.DynamicPseudoType),
},
},
VarParam: &function.Parameter{
Name: "other_sets",
Description: "",
Type: cty.Set(cty.DynamicPseudoType),
},
ReturnType: cty.Set(cty.DynamicPseudoType),
Description: "The `setintersection` function takes multiple sets and produces a single set containing only the elements that all of the given sets have in common. In other words, it computes the [intersection](https://en.wikipedia.org/wiki/Intersection_\\(set_theory\\)) of the sets.",
},
"setproduct": {
VarParam: &function.Parameter{
Name: "sets",
Description: "The sets to consider. Also accepts lists and tuples, and if all arguments are of list or tuple type then the result will preserve the input ordering",
Type: cty.DynamicPseudoType,
},
ReturnType: cty.DynamicPseudoType,
Description: "The `setproduct` function finds all of the possible combinations of elements from all of the given sets by computing the [Cartesian product](https://en.wikipedia.org/wiki/Cartesian_product).",
},
"setsubtract": {
Params: []function.Parameter{
{
Name: "a",
Type: cty.Set(cty.DynamicPseudoType),
},
{
Name: "b",
Type: cty.Set(cty.DynamicPseudoType),
},
},
ReturnType: cty.Set(cty.DynamicPseudoType),
Description: "The `setsubtract` function returns a new set containing the elements from the first set that are not present in the second set. In other words, it computes the [relative complement](https://en.wikipedia.org/wiki/Complement_\\(set_theory\\)#Relative_complement) of the second set.",
},
"setunion": {
Params: []function.Parameter{
{
Name: "first_set",
Type: cty.Set(cty.DynamicPseudoType),
},
},
VarParam: &function.Parameter{
Name: "other_sets",
Description: "",
Type: cty.Set(cty.DynamicPseudoType),
},
ReturnType: cty.Set(cty.DynamicPseudoType),
Description: "The `setunion` function takes multiple sets and produces a single set containing the elements from all of the given sets. In other words, it computes the [union](https://en.wikipedia.org/wiki/Union_\\(set_theory\\)) of the sets.",
},
"sha1": {
Params: []function.Parameter{
{
Name: "str",
Type: cty.String,
},
},
ReturnType: cty.String,
Description: "`sha1` computes the SHA1 hash of a given string and encodes it with hexadecimal digits.",
},
"sha256": {
Params: []function.Parameter{
{
Name: "str",
Type: cty.String,
},
},
ReturnType: cty.String,
Description: "`sha256` computes the SHA256 hash of a given string and encodes it with hexadecimal digits.",
},
"sha512": {
Params: []function.Parameter{
{
Name: "str",
Type: cty.String,
},
},
ReturnType: cty.String,
Description: "`sha512` computes the SHA512 hash of a given string and encodes it with hexadecimal digits.",
},
"signum": {
Params: []function.Parameter{
{
Name: "num",
Type: cty.Number,
},
},
ReturnType: cty.Number,
Description: "`signum` determines the sign of a number, returning a number between -1 and 1 to represent the sign.",
},
"slice": {
Params: []function.Parameter{
{
Name: "list",
Type: cty.DynamicPseudoType,
},
{
Name: "start_index",
Type: cty.Number,
},
{
Name: "end_index",
Type: cty.Number,
},
},
ReturnType: cty.DynamicPseudoType,
Description: "`slice` extracts some consecutive elements from within a list.",
},
"sort": {
Params: []function.Parameter{
{
Name: "list",
Type: cty.List(cty.String),
},
},
ReturnType: cty.List(cty.String),
Description: "`sort` takes a list of strings and returns a new list with those strings sorted lexicographically.",
},
"split": {
Params: []function.Parameter{
{
Name: "separator",
Type: cty.String,
},
{
Name: "str",
Type: cty.String,
},
},
ReturnType: cty.List(cty.String),
Description: "`split` produces a list by dividing a given string at all occurrences of a given separator.",
},
"startswith": {
Params: []function.Parameter{
{
Name: "str",
Type: cty.String,
},
{
Name: "prefix",