You can use terraform functions base64encode() and base64decode() to encode and decode a string in base64. base64encode() applies Base64 encoding to a string and base64decode() takes a string containing a Base64 character sequence and returns the original string.
Syntax: base64encode(utf8_string) base64decode(base64_string)
Example:
1 2 3 4 5 6 7 8 9 10 |
## Open terraform console terraform console ## Encode a string in base64 base64encode("cloudaffaire") ## returns "Y2xvdWRhZmZhaXJl" ## Decode a base64 string base64decode("Y2xvdWRhZmZhaXJl") ## returns "cloudaffaire" |