-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstring_functions.tf
More file actions
81 lines (62 loc) · 1.93 KB
/
Copy pathstring_functions.tf
File metadata and controls
81 lines (62 loc) · 1.93 KB
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
output "chomp" {
value = chomp("hello\n\r\n")
description = "Remove newline characters at the end of a string"
}
output "format" {
value = format("%%, %v, %#v, %t, %b, %d, %o, %x, %X, %e, %E, %9.8f, %g, %G, %s, %q", "%v - type infer", { key = "value" }, true, 255, 255, 255, 255, 255, 1234567890, 1234567890, 123.456, 1234567890, 1234567890, "convert to string", "this is just a test")
}
output "formatlist" {
value = formatlist("%s => %s", ["key1", "key2", "key3"], ["value1", "value2", "value3"])
}
output "formatlist2" {
value = formatlist("%s => %s", "Hello", ["Alice", "Bob", "Eve"])
}
output "indent" {
value = indent(2, "[\n foo,\n bar,\n]\n")
description = "Add a given number of spaces to the beginnings of al but the first line in a given multi-line string."
}
output "join" {
value = join(", ", ["foo", "bar", "baz"])
}
output "lower" {
value = lower("HeLLo!")
}
output "regex" {
value = regex("^(?:(?P<scheme>[^:/?#]+):)?(?://(?P<authority>[^/?#]*))?", "https://terraform.io/docs/")
}
output "regexall" {
value = regexall("[a-z]+", "1234abcd5678efgh9")
}
output "replace" {
value = replace("hello world", "/w.*d/", "everybody")
}
output "split" {
value = split(",", "foo,bar,baz")
}
output "strrev" {
value = strrev("hello")
description = "strrev reverses the cahracters in a string."
}
output "substr" {
value = substr("hello world", 1, 4)
}
output "title" {
value = title("hello world")
description = "title converts the first letter of each word in the given string to uppercase"
}
output "trim" {
value = trim("?!hello?!", "?!")
description = "trim removes the specified characters from the start and end of the given string"
}
output "trimprefix" {
value = trimprefix("helloworld", "hello")
}
output "trimsuffix" {
value = trimsuffix("helloworld", "world")
}
output "trimspace" {
value = trimspace(" a b c d e \n\r\n")
}
output "upper" {
value = upper("hEllO!")
}