Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Converts JSON values to terraform values (everything as strings)
def nullString: (
if . == null then "" else . end
);
def terraformify: ( .. |=
if type == "object" then
to_entries | map(.value |= nullString) | from_entries
elif type == "array" then
map(nullString)
elif . == true then
"1"
elif . == false then
"0"
else
tostring
end
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment