You can use terraform split() function to split a string into multiple list of strings in terraform. split() produces a list by dividing a given string at all occurrences of a given separator.
Syntax: split(separator, string)
Open terraform console
1 2 |
## Open terraform console terraform console |
Split a string into multiple list of strings in terraform
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
## Split a string into multiple list of strings split("-","cloud-affaire") ## returns ## [ ## "cloud", ## "affaire", ## ] split("@","cloudaffaire@gamil.com") ## returns ## [ ## "cloudaffaire", ## "gamil.com", ## ] |