Sprig provide all kind for text manipulation functions (and more).
We use this code in our plan template to remove terrafrom's overly verbose "Refreshing state" lines and the trailing suffix meant for manual user interaction, by cutting above and bellow the "------" delimiter terrafrom adds:
index (regexSplit "(?m)^---+$\n" .Body -1 ) 1
WHAT
Adding support for Sprig functions (https://github.com/Masterminds/sprig) in the templating mechanisms.
WHY
Sprig provide all kind for text manipulation functions (and more). We use this code in our plan template to remove terrafrom's overly verbose "Refreshing state" lines and the trailing suffix meant for manual user interaction, by cutting above and bellow the "------" delimiter terrafrom adds:
index (regexSplit "(?m)^---+$\n" .Body -1 ) 1