Quantcast
Viewing latest article 22
Browse Latest Browse All 30

Takes a list of VPC names and outputs their ID and CIDR

cidrs.tf
data"aws_vpc""found" {
count ="${length(var.vpc_names)}"
filter {
name ="tag:Name"
values = ["${element(var.vpc_names, count.index)}"]
}
}
output"vpc_id" {
value ="${formatlist("%21s %s", data.aws_vpc.found.*.id, data.aws_vpc.found.*.cidr_block)}"
}

Viewing latest article 22
Browse Latest Browse All 30

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>