小编Abh*_*mar的帖子

Terraform:创建 SG 时属性“ingress”的值不合适

我正在使用 terraform 创建一个安全组,当我运行 terraform 计划时。它给我一个错误,比如某些字段是必需的,而所有这些字段都是可选的。

\n

地形版本:v1.0.5

\n

AWS 提供商版本:v3.57.0

\n
\n

主.tf

\n
\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)

amazon-web-services terraform terraform-provider-aws

14
推荐指数
2
解决办法
8459
查看次数