title: Getting the CIDR block of a set of subnets
body: <p>I am trying to get the CIDR block of a set of subnets IDs provided a parameter.</p>
  
  <pre><code>data "aws_subnet" "target" {
    for_each = "${toset(var.subnet_ids)}"
    id       = "${each.value}"
  }
  
  resource "aws_security_group" "registry" {
    vpc_id = "${var.vpc_id}"
    ingress {
      from_port   = 443
      to_port     = 443
      protocol    = "tcp"
      cidr_blocks = ["${data.aws_subnet.target.*.cidr_block}"]
    }
    tags = {
      Name = "${var.name}"
    }
  }
  </code></pre>
  
  <p>The error I am getting is: </p>
  
  <pre><code>cidr_blocks = "${data.aws_subnet.target.*.cidr_block}"
  
  This object does not have an attribute named "cidr_block".
  </code></pre>
  
  <p>Terraform configuration:</p>
  
  <pre><code>Terraform v0.12.24
  + provider.aws v2.55.0
  + provider.template v2.1.2
  </code></pre>
  
  <p>Thanks to whoever can help!</p>