我正在尝试在aws_cloudfront_distribution
中传递多个别名记录。我尝试使用连接使用分隔符从列表中分离字符串,但是它给出了以下错误。
resource "aws_cloudfront_distribution" "s3_distribution" {
...
...
...
aliases = [
"${join(", ", var.aliases)}",
]
...
...
}
var.aliases在父模块中定义如下。
aliases = ["a.domain.com", "b.domain.com"]
它正尝试如下替换当前记录。发生这种情况是因为我从GUI控制台添加了别名。
An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
~ update in-place
Terraform will perform the following actions:
~ module.cms_cloudfront_distribution.aws_cloudfront_distribution.s3_distribution
aliases.#: "2" => "1"
aliases.1679894134: "" => "a.domain.com, b.domain.com"
aliases.2810533754: "a.domain.com" => ""
aliases.3301490091: "b.domain.com" => ""