amazon-web-services - 我在进行 terragrunt apply 时收到 CIDR 错误
问题描述
模块/sg 内的 main.tf
//vpc_id = var.vpc_id
//all inbound traffic
ingress {
from_port = "22" //opens tcp 22 port for ssh
to_port = "22"
protocol = "tcp"
cidr_blocks = [var.trusted_ip_ingress]
}
}
模块/sg 内的 variable.tf
variable "trusted_ip_ingress" {}
terragrunt.hcl
source = "./../../../modules//sg"
}
inputs = {
trusted_ip_ingress = ["0.0.0.0/0"]
}
请在执行 terragrunt plan 时找到错误 在执行 terragrunt plan 时出现错误消息
解决方案
你trusted_ip_ingress
的已经是一个列表。所以你应该使用:
ingress {
from_port = "22" //opens tcp 22 port for ssh
to_port = "22"
protocol = "tcp"
cidr_blocks = var.trusted_ip_ingress
}
推荐阅读
- unit-testing - 使用 Mockk 进行单元测试,java.lang.ClassCastException:PhoneValidationKt$isPhoneValid$1 无法转换为 kotlin.jvm.functions.Function1
- microsoft-graph-api - 在 365 群组上设置群组设置
- android - 如何将逻辑移动到 ViewModel?
- monitoring - 监控自指标更改以来的秒数作为普罗米修斯时间序列
- html - Flask:如何使用从数据库中获取的值作为函数的输入
- reactjs - 类型“{}”.ts(2339) 上不存在属性“详细信息”
- openssl - 在什么情况下,您会将 openssl ca 的 `unique_subject` 设置为 yes?
- python-3.x - tkinter TclError:小部件属性上的未知选项
- typescript - 如何在 TypeScript 中克隆类实例?
- android - IllegalStateException:已添加片段:FragmentPagerAdapter