-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathnatgw.tf
18 lines (17 loc) · 867 Bytes
/
natgw.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
##################################################
# File: natgw.tf #
# Created Date: 03192019 #
# Author: Fred Stuck #
# Version: 0.1 #
# Description: Creates an NAT Gateway #
# #
# Change History: #
# 03192019: Initial File #
# 03282019: Changed count to same as EIP #
# #
##################################################
resource "aws_nat_gateway" "natgw" {
count = contains(keys(var.subnets), "pub") && !(var.deploy_natgateways == false) ? local.num-availbility-zones : 0
allocation_id = aws_eip.eip.*.id[count.index]
subnet_id = local.pub-subnet-ids[count.index]
}