title: Terraform circular dependency between security groups
body: <p>I have a setup: ALB in front of ECS. I have a module of ecs and one for alb:
  The egress rule of the ALB of <code>alb_sg</code>:</p>
  <pre><code>  egress {
      description     = &quot;Traffic from ALB to ECS&quot;
      from_port       = 80
      to_port         = 80
      protocol        = &quot;tcp&quot;
      security_groups = [var.ecs_sg] //comes from output from ecs stack
    } 
  </code></pre>
  <p>Now in ECS I have something like this for its security group (<code>ecs_sg</code>)</p>
  <pre><code>  ingress {
      description = &quot;Allow ALB to ECS&quot;
      from_port   = 80
      to_port     = 80
      protocol    = &quot;tcp&quot;
      security_groups = [var.alb_sg] //comes from output from alb stack
    }
  </code></pre>
  <p>Now I have some error:</p>
  <pre><code>│ Error: Cycle: module.ecs.var.alb_sg (expand), module.ecs.aws_security_group.ecs_sg, module.ecs.output.ecs_sg (expand), module.alb.var.ecs_sg (expand), module.alb.aws_security_group.alb_sg, module.alb.output.alb_sg (expand)
  </code></pre>
  <p>How can this be solved? Thanks</p>