我在Terraform中有两个字符串:
"1.1.1.1,2.2.2.2"
"3.3.3.3,4.4.4.4"
我如何获得
"1.1.1.1,2.2.2.2,3.3.3.3,4.4.4.4"
似乎很琐碎,但找不到它的功能/解决方法。
答案 0 :(得分:2)
string templates和join是我所寻求的直接解决方案:
locals {
string1 = "1.1.1.1,2.2.2.2"
string2 = "3.3.3.3,4.4.4.4"
strings_join = join(",", [local.string1, local.string2])
strings_template = "${local.string1},${local.string2}"
}