opentofu/examples/aws-networking/region/subnets.tf
Martin Atkins 0e3256b6f4 examples: creating VPCs and subnets across two regions
This example demonstrates both creating a network architecture *and* the
use of data resources to minimize the number of variables needed for a
child module by discovering additional data automatically.
2016-09-24 15:19:34 -07:00

15 lines
390 B
HCL

data "aws_availability_zones" "all" {
}
module "primary_subnet" {
source = "../subnet"
vpc_id = "${aws_vpc.main.id}"
availability_zone = "${data.aws_availability_zones.all.names[0]}"
}
module "secondary_subnet" {
source = "../subnet"
vpc_id = "${aws_vpc.main.id}"
availability_zone = "${data.aws_availability_zones.all.names[1]}"
}