Skip to content

Commit 8e2f50e

Browse files
committed
Reordered vars in count for database_nat_gateway route
1 parent 2d5627d commit 8e2f50e

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
repos:
22
- repo: git://github.com/antonbabenko/pre-commit-terraform
3-
rev: v1.7.4
3+
rev: v1.8.1
44
hooks:
55
- id: terraform_fmt
66
- id: terraform_docs
77
- repo: git://github.com/pre-commit/pre-commit-hooks
8-
rev: v2.0.0
8+
rev: v2.1.0
99
hooks:
1010
- id: check-merge-conflict

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ Terraform version 0.10.3 or newer is required for this module to work.
184184
| azs | A list of availability zones in the region | list | `[]` | no |
185185
| cidr | The CIDR block for the VPC. Default value is a valid CIDR, but not acceptable by AWS and should be overridden | string | `"0.0.0.0/0"` | no |
186186
| create\_database\_internet\_gateway\_route | Controls if an internet gateway route for public database access should be created | string | `"false"` | no |
187+
| create\_database\_nat\_gateway\_route | Controls if a nat gateway route should be created to give internet access to the database subnets | string | `"false"` | no |
187188
| create\_database\_subnet\_group | Controls if database subnet group should be created | string | `"true"` | no |
188189
| create\_database\_subnet\_route\_table | Controls if separate route table for database should be created | string | `"false"` | no |
189190
| create\_elasticache\_subnet\_group | Controls if elasticache subnet group should be created | string | `"true"` | no |

main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ resource "aws_route" "database_internet_gateway" {
134134
}
135135

136136
resource "aws_route" "database_nat_gateway" {
137-
count = "${var.create_vpc && var.enable_nat_gateway && var.create_database_subnet_route_table && length(var.database_subnets) > 0 && var.create_database_nat_gateway_route && !var.create_database_internet_gateway_route ? local.nat_gateway_count : 0}"
137+
count = "${var.create_vpc && var.create_database_subnet_route_table && length(var.database_subnets) > 0 && !var.create_database_internet_gateway_route && var.create_database_nat_gateway_route && var.enable_nat_gateway ? local.nat_gateway_count : 0}"
138138
route_table_id = "${element(aws_route_table.private.*.id, count.index)}"
139139
destination_cidr_block = "0.0.0.0/0"
140140
nat_gateway_id = "${element(aws_nat_gateway.this.*.id, count.index)}"

0 commit comments

Comments
 (0)