Skip to content

Commit baca66e

Browse files
authored
Update networking module (#36)
1 parent 65562a1 commit baca66e

File tree

1 file changed

+43
-8
lines changed

1 file changed

+43
-8
lines changed

examples/test/main.tf

Lines changed: 43 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,46 @@
11
module "base-network" {
2-
source = "cn-terraform/networking/aws"
3-
version = "2.0.13"
4-
name_prefix = "test-networking"
5-
vpc_cidr_block = "192.168.0.0/16"
6-
availability_zones = ["us-east-1a", "us-east-1b", "us-east-1c", "us-east-1d"]
7-
public_subnets_cidrs_per_availability_zone = ["192.168.0.0/19", "192.168.32.0/19", "192.168.64.0/19", "192.168.96.0/19"]
8-
private_subnets_cidrs_per_availability_zone = ["192.168.128.0/19", "192.168.160.0/19", "192.168.192.0/19", "192.168.224.0/19"]
2+
source = "cn-terraform/networking/aws"
3+
version = "3.0.0"
4+
5+
cidr_block = "192.168.0.0/16"
6+
7+
public_subnets = {
8+
first_public_subnet = {
9+
availability_zone = "us-east-1a"
10+
cidr_block = "192.168.0.0/19"
11+
}
12+
second_public_subnet = {
13+
availability_zone = "us-east-1b"
14+
cidr_block = "192.168.32.0/19"
15+
}
16+
third_public_subnet = {
17+
availability_zone = "us-east-1c"
18+
cidr_block = "192.168.64.0/19"
19+
}
20+
fourth_public_subnet = {
21+
availability_zone = "us-east-1d"
22+
cidr_block = "192.168.96.0/19"
23+
}
24+
}
25+
26+
private_subnets = {
27+
first_private_subnet = {
28+
availability_zone = "us-east-1a"
29+
cidr_block = "192.168.128.0/19"
30+
}
31+
second_private_subnet = {
32+
availability_zone = "us-east-1b"
33+
cidr_block = "192.168.160.0/19"
34+
}
35+
third_private_subnet = {
36+
availability_zone = "us-east-1c"
37+
cidr_block = "192.168.192.0/19"
38+
}
39+
fourth_private_subnet = {
40+
availability_zone = "us-east-1d"
41+
cidr_block = "192.168.224.0/19"
42+
}
43+
}
944
}
1045

1146
module "cluster" {
@@ -28,7 +63,7 @@ module "task" {
2863
event_rule_name = "test-rule"
2964
event_rule_schedule_expression = "cron(0 20 * * ? *)"
3065
ecs_cluster_arn = module.cluster.aws_ecs_cluster_cluster_arn
31-
event_target_ecs_target_subnets = module.base-network.public_subnets_ids
66+
event_target_ecs_target_subnets = [for subnet in module.base-network.public_subnets : subnet.id]
3267
event_target_ecs_target_task_definition_arn = module.td.aws_ecs_task_definition_td_arn
3368
ecs_execution_task_role_arn = "Put your execution role ARN here"
3469
ecs_task_role_arn = "Put your role ARN here"

0 commit comments

Comments
 (0)