Terraform replace function

From wikieduonline
Revision as of 12:48, 7 June 2022 by Welcome (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

https://www.terraform.io/language/functions/replace

replace(string, substring, replacement)

Examples[edit]

> replace("1 + 2 + 3", "+", "-")
1 - 2 - 3
> replace("hello world", "/w.*d/", "everybody")
hello everybody


locals {
  name   = "example-${replace(basename(path.cwd), "_", "-")}"
  region = "eu-west-1"
  tags = {
    Owner       = "user"
    Environment = "dev"
 }
}


See also[edit]

Advertising: