我正在使用 terraform 创建一个安全组,当我运行 terraform 计划时。它给我一个错误,比如某些字段是必需的,而所有这些字段都是可选的。
\n地形版本:v1.0.5
\nAWS 提供商版本:v3.57.0
\n\n\n主.tf
\n
resource "aws_security_group" "sg_oregon" {\n name = "tf-sg"\n description = "Allow web traffics"\n vpc_id = aws_vpc.vpc_terraform.id\n\n ingress = [\n {\n description = "HTTP"\n from_port = 80\n to_port = 80\n protocol = "tcp"\n cidr_blocks = ["0.0.0.0/0"] \n },\n {\n description = "HTTPS"\n from_port = 443\n to_port = 443\n protocol = "tcp"\n cidr_blocks = ["0.0.0.0/0"] \n },\n\n {\n description = "SSH"\n from_port = 22\n to_port = 22\n protocol …Run Code Online (Sandbox Code Playgroud)