mirror of
https://github.com/opentofu/opentofu.git
synced 2025-01-08 23:23:59 -06:00
0e3256b6f4
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.
15 lines
390 B
HCL
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]}"
|
|
}
|