0

main.tf inside modules/sg

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

variable.tf inside modules/sg

variable "trusted_ip_ingress" {}

terragrunt.hcl

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

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

Please find the error while doing terragrunt plan error message while doing terragrunt plan

  • How did it go? I see you asked new question, without accepting my answer to your old question, or even explain why it is not satisfactory? – Marcin May 21 '21 at 05:25

1 Answers1

1

Your trusted_ip_ingress is already a list. So you should use:

  ingress {
    from_port   = "22" //opens tcp 22 port for ssh
    to_port     = "22"
    protocol    = "tcp"
    cidr_blocks =  var.trusted_ip_ingress
  }
Marcin
  • 215,873
  • 14
  • 235
  • 294