1

我正在尝试让 terraform 根据以下计数条件创建资源,我无法理解语法,它应该如下所示:

count = “${var.size[terraform.workspace] == "big" ? && local.ips[terraform.workspace] != “<none>“} then 10
elseif
${var.size[terraform.workspace] == "small"  && local.ips[terraform.workspace] != “<none>” } then 20
else 0 
4

1 回答 1

0

下面测试,

count = "${lookup(var.size, terraform.workspace, "None") == "big" && lookup(local.ips, terraform.workspace, "None") != "None" ? 10 : lookup(var.size, terraform.workspace, "None") == "small" && lookup(local.ips, terraform.workspace, "None") != "None" ? 20 : 0}"
于 2019-07-19T16:54:48.320 回答