【问题标题】:I getting CIDR error while doing terragrunt apply执行 terragrunt apply 时出现 CIDR 错误
【发布时间】:2021-08-05 18:33:15
【问题描述】:

modules/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]
  }
}

modules/sg 中的变量.tf

variable "trusted_ip_ingress" {}

terragrunt.hcl

  source = "./../../../modules//sg"
}

inputs = {
  trusted_ip_ingress = ["0.0.0.0/0"]
}

请在执行 terragrunt plan 时发现错误 error message while doing terragrunt plan

【问题讨论】:

  • 进展如何?我看到您提出了新问题,但没有接受我对您的旧问题的回答,甚至没有解释为什么它不令人满意?

标签: amazon-web-services terraform aws-security-group terragrunt


【解决方案1】:

您的trusted_ip_ingress 已经是一个列表。所以你应该使用:

  ingress {
    from_port   = "22" //opens tcp 22 port for ssh
    to_port     = "22"
    protocol    = "tcp"
    cidr_blocks =  var.trusted_ip_ingress
  }

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-07-06
    • 2017-08-29
    • 2015-09-27
    • 1970-01-01
    相关资源
    最近更新 更多