【发布时间】:2020-02-19 04:01:33
【问题描述】:
variable "cidr" {
type = map(string)
default = {
development = "x.1.0.0/16"
qa = "x.1.0.0/16"
default = "x.1.0.0/16"
}
}
variable "network_address_space" {
default = lookup(var.cidr, var.environment_name,"default")
}
我收到“错误:不允许函数调用”的错误
variable "subnet_address_space": cidr_subnet2_address_space = cidrsubnet(var.network_address_space,8,1)
【问题讨论】:
-
您不能在变量中使用插值或函数调用。请改用
local。 -
哦,听到这个消息很难过。是因为动态吗?
标签: terraform terraform-provider-aws