|
1 | 1 | module "base-network" {
|
2 |
| - source = "cn-terraform/networking/aws" |
3 |
| - version = "2.0.16" |
| 2 | + source = "cn-terraform/networking/aws" |
| 3 | + version = "3.0.0" |
4 | 4 |
|
5 |
| - name_prefix = "test-networking" |
6 |
| - vpc_cidr_block = "192.168.0.0/16" |
7 |
| - availability_zones = ["us-east-1a", "us-east-1b", "us-east-1c", "us-east-1d"] |
8 |
| - 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"] |
9 |
| - 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"] |
| 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 | + } |
10 | 44 | }
|
11 | 45 |
|
12 | 46 | module "sonar" {
|
13 | 47 | source = "../../"
|
14 | 48 | name_prefix = "sonar"
|
15 | 49 | region = "us-east-1"
|
16 | 50 | vpc_id = module.base-network.vpc_id
|
17 |
| - public_subnets_ids = module.base-network.public_subnets_ids |
18 |
| - private_subnets_ids = module.base-network.private_subnets_ids |
| 51 | + public_subnets_ids = [for subnet in module.base-network.public_subnets : subnet.id] |
| 52 | + private_subnets_ids = [for subnet in module.base-network.private_subnets : subnet.id] |
19 | 53 | db_instance_size = "db.t3.medium"
|
20 | 54 | enable_ssl = false
|
21 | 55 | lb_https_ports = {}
|
|
0 commit comments