【发布时间】:2021-04-12 19:48:56
【问题描述】:
我使用 aws 提供程序。对于每个安全组,我为 ssh 指定相同的规则。如何将其提取到变量并分配给 aws_security_group.ingress 列表?
我期待什么:
variable "ssh_ingress" {
default = {
from_port = 22
protocol = "tcp"
to_port = 22
description = "SSH for administration."
}
}
resource "aws_security_group" "main" {
ingress += var.ssh_ingress // That not work.
ingress {
from_port = 0
protocol = "-1"
to_port = 0
self = true
}
}
【问题讨论】:
标签: amazon-web-services terraform hcl