locals {
  cidr_block = var.cidr != null ? var.cidr : "10.0.0.0/16"
  az_list    = split(",", var.azs)
  name_tag   = var.name != null ? var.name : "nova-vpc"

  # Derive subnet CIDRs from the VPC CIDR
  subnet_cidrs = [
    for i in range(length(local.az_list)) : cidrsubnet(local.cidr_block, 8, i + 1)
  ]
}
