How to encode and decode YAML data in terraform?

You can use terraform yamlencode() and yamldecode() functions to encode and decode YAML data. yamlencode() encodes a given value to a string using YAML 1.2 block syntax and yamldecode() parses a string as a subset of YAML and produces a representation of its value.

Syntax: yamlencode(string) yamldecode(string)

Example:

Leave a Reply

Close Menu