title: Terraform - expected cidr_block to contain a valid Value, got: 0.0.0.0 with err: invalid CIDR address: 0.0.0.0
body: <p>I'm going through the <a href="https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/security_group" rel="nofollow noreferrer">documentation</a> and they have <code>aws_vpc.main.cidr_block</code> in a resource. I defined the resource which isn't in the documentation but I the following error.</p>
  <p><code>Terraform - expected cidr_block to contain a valid Value, got: 0.0.0.0 with err: invalid CIDR address: 0.0.0.0</code></p>
  <p>Why is it invalid? I want to allow ingress all source IP to be able to reach 443.</p>
  <p>File vpc.tf</p>
  <pre><code>resource &quot;aws_vpc&quot; &quot;main&quot; {
      id = &quot;vpc-0da86af9876e72d66c&quot;
      cidr_block = &quot;0.0.0.0/0&quot;
  }
  </code></pre>
  <p>File test.tf</p>
  <pre><code>resource &quot;aws_security_group&quot; &quot;allow_tls&quot; {
    name        = &quot;allow_tls&quot;
    description = &quot;Allow TLS inbound traffic&quot;
    vpc_id      = aws_vpc.main.id
  
    ingress {
      description = &quot;TLS from VPC&quot;
      from_port   = 443
      to_port     = 443
      protocol    = &quot;tcp&quot;
      cidr_blocks = [aws_vpc.main.cidr_block]
    }
  
    egress {
      from_port   = 0
      to_port     = 0
      protocol    = &quot;-1&quot;
      cidr_blocks = [&quot;0.0.0.0/0&quot;]
    }
  
    tags = {
      Name = &quot;allow_tls&quot;
    }
  }
  </code></pre>