Files
opentf/website/docs/configuration/functions/indent.html.md
Nicolas Vogel 8f42f0fa77 Fix documentation example for the indent function
We must use interpolation, using the %{} directive will trigger the following error  "indent" is not a valid template control keyword
2020-08-10 11:45:28 +02:00

999 B

layout, page_title, sidebar_current, description
layout page_title sidebar_current description
functions indent - Functions - Configuration Language docs-funcs-string-indent The indent function adds a number of spaces to the beginnings of all but the first line of a given multi-line string.

indent Function

-> Note: This page is about Terraform 0.12 and later. For Terraform 0.11 and earlier, see 0.11 Configuration Language: Interpolation Syntax.

indent adds a given number of spaces to the beginnings of all but the first line in a given multi-line string.

indent(num_spaces, string)

Examples

This function is useful for inserting a multi-line string into an already-indented context in another string:

> "  items: ${indent(2, "[\n  foo,\n  bar,\n]\n")}"
  items: [
    foo,
    bar,
  ]

The first line of the string is not indented so that, as above, it can be placed after an introduction sequence that has already begun the line.