terraform/website/docs/configuration/functions/replace.html.md

746 B

layout page_title sidebar_current description
functions replace - Functions - Configuration Language docs-funcs-string-replace The replace function searches a given string for another given substring, and replaces all occurrences with a given replacement string.

replace Function

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

replace searches a given string for another given substring, and replaces each occurrence with a given replacement string.

replace(string, substring, replacement)

Examples

> replace("1 + 2 + 3", "+", "-")
1 - 2 - 3