Skip to content

Commit 1610c3c

Browse files
committed
fix: Correct security group port overlap
1 parent 0e47807 commit 1610c3c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

main.tf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -767,7 +767,7 @@ resource "aws_vpc_security_group_egress_rule" "this" {
767767
cidr_ipv4 = each.value.cidr_ipv4
768768
cidr_ipv6 = each.value.cidr_ipv6
769769
description = each.value.description
770-
from_port = coalesce(each.value.from_port, each.value.to_port)
770+
from_port = try(coalesce(each.value.from_port, each.value.to_port), null)
771771
ip_protocol = each.value.ip_protocol
772772
prefix_list_id = each.value.prefix_list_id
773773
referenced_security_group_id = each.value.referenced_security_group_id
@@ -780,7 +780,7 @@ resource "aws_vpc_security_group_egress_rule" "this" {
780780
each.value.tags,
781781
)
782782

783-
to_port = coalesce(each.value.to_port, each.value.from_port)
783+
to_port = try(coalesce(each.value.to_port, each.value.from_port), null)
784784
}
785785

786786
resource "aws_vpc_security_group_ingress_rule" "this" {
@@ -791,7 +791,7 @@ resource "aws_vpc_security_group_ingress_rule" "this" {
791791
cidr_ipv4 = each.value.cidr_ipv4
792792
cidr_ipv6 = each.value.cidr_ipv6
793793
description = each.value.description
794-
from_port = coalesce(each.value.from_port, each.value.to_port)
794+
from_port = try(coalesce(each.value.from_port, each.value.to_port), null)
795795
ip_protocol = each.value.ip_protocol
796796
prefix_list_id = each.value.prefix_list_id
797797
referenced_security_group_id = each.value.referenced_security_group_id
@@ -804,7 +804,7 @@ resource "aws_vpc_security_group_ingress_rule" "this" {
804804
each.value.tags,
805805
)
806806

807-
to_port = coalesce(each.value.to_port, each.value.from_port)
807+
to_port = try(coalesce(each.value.to_port, each.value.from_port), null)
808808
}
809809

810810
################################################################################

0 commit comments

Comments
 (0)