Skip to content

Commit 7b7e08d

Browse files
authored
fix: Output list of external_nat_ips when using external eips (#432)
1 parent c09d65d commit 7b7e08d

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,7 @@ It is possible to integrate this VPC module with [terraform-aws-transit-gateway
453453
| events\_endpoint\_security\_group\_ids | The ID of one or more security groups to associate with the network interface for CloudWatch Events endpoint | `list(string)` | `[]` | no |
454454
| events\_endpoint\_subnet\_ids | The ID of one or more subnets in which to create a network interface for CloudWatch Events endpoint. Only a single subnet within an AZ is supported. If omitted, private subnets will be used. | `list(string)` | `[]` | no |
455455
| external\_nat\_ip\_ids | List of EIP IDs to be assigned to the NAT Gateways (used in combination with reuse\_nat\_ips) | `list(string)` | `[]` | no |
456+
| external\_nat\_ips | List of EIPs to be used for `nay_public_ips` output (used in combination with reuse\_nat\_ips and external\_nat\_ip\_ids) | `list(string)` | `[]` | no |
456457
| flow\_log\_cloudwatch\_iam\_role\_arn | The ARN for the IAM role that's used to post flow logs to a CloudWatch Logs log group. When flow\_log\_destination\_arn is set to ARN of Cloudwatch Logs, this argument needs to be provided. | `string` | `""` | no |
457458
| flow\_log\_cloudwatch\_log\_group\_kms\_key\_id | The ARN of the KMS Key to use when encrypting log data for VPC flow logs. | `string` | `null` | no |
458459
| flow\_log\_cloudwatch\_log\_group\_name\_prefix | Specifies the name prefix of CloudWatch Log Group for VPC flow logs. | `string` | `"/aws/vpc-flow-log/"` | no |

outputs.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ output "nat_ids" {
320320

321321
output "nat_public_ips" {
322322
description = "List of public Elastic IPs created for AWS NAT Gateway"
323-
value = aws_eip.nat.*.public_ip
323+
value = var.reuse_nat_ips ? var.external_nat_ips : aws_eip.nat.*.public_ip
324324
}
325325

326326
output "natgw_ids" {

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,12 @@ variable "external_nat_ip_ids" {
298298
default = []
299299
}
300300

301+
variable "external_nat_ips" {
302+
description = "List of EIPs to be used for `nay_public_ips` output (used in combination with reuse_nat_ips and external_nat_ip_ids)"
303+
type = list(string)
304+
default = []
305+
}
306+
301307
variable "enable_dynamodb_endpoint" {
302308
description = "Should be true if you want to provision a DynamoDB endpoint to the VPC"
303309
type = bool

0 commit comments

Comments
 (0)