File tree Expand file tree Collapse file tree 4 files changed +42
-0
lines changed
Expand file tree Collapse file tree 4 files changed +42
-0
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,11 @@ variable "private_persistence_subnets" {
2626 default = []
2727}
2828
29+ variable "spare_subnets" {
30+ description = " A list of CIDR blocks for spare subnets inside the VPC."
31+ default = []
32+ }
33+
2934# # VPC-Peering variables
3035# Default values assigned inorder to mark them optional
3136variable "peer_vpc_id" {
@@ -112,6 +117,15 @@ module "private_persistence_subnet" {
112117 azs = " ${ var . azs } "
113118}
114119
120+ module "spare_subnet" {
121+ source = " ./spare-subnet"
122+
123+ name = " ${ var . name } -spare"
124+ vpc_id = " ${ module . vpc . vpc_id } "
125+ spare_subnets = " ${ var . spare_subnets } "
126+ azs = " ${ var . azs } "
127+ }
128+
115129module "network_acl" {
116130 source = " ./network-acl"
117131
Original file line number Diff line number Diff line change 1+ resource "aws_subnet" "spare" {
2+ vpc_id = " ${ var . vpc_id } "
3+ cidr_block = " ${ var . spare_subnets [count . index ]} "
4+ availability_zone = " ${ var . azs [count . index ]} "
5+ count = " ${ length (var. azs )} "
6+
7+ tags {
8+ Name = " ${ var . name } -${ var . azs [count . index ]} "
9+ }
10+ }
Original file line number Diff line number Diff line change 1+ output "subnet_ids" {
2+ value = " ${ join (" ," , aws_subnet. spare . * . id )} "
3+ }
Original file line number Diff line number Diff line change 1+ variable "name" {
2+ default = " spare"
3+ }
4+
5+ variable "vpc_id" {}
6+
7+ variable "spare_subnets" {
8+ description = " A list of CIDR blocks for spare subnets inside the VPC."
9+ type = " list"
10+ }
11+
12+ variable "azs" {
13+ description = " A list of Availability zones in the region"
14+ type = " list"
15+ }
You can’t perform that action at this time.
0 commit comments