@@ -39,10 +39,10 @@ data "aws_security_group" "existing" {
3939# # Below resources will create SECURITY-GROUP-RULE and its components.
4040# #----------------------------------------------------------------------------------
4141# tfsec:ignore:aws-ec2-no-public-egress-sgr
42- # tfsec:ignore:aws-ec2-add-description-to-security-group-rule
4342resource "aws_security_group_rule" "egress" {
4443 count = (var. enable_security_group == true && length (var. sg_ids ) < 1 && var. is_external == false && var. egress_rule == true ) ? 1 : 0
4544
45+ description = var. sg_egress_description
4646 type = " egress"
4747 from_port = 0
4848 to_port = 65535
@@ -51,21 +51,21 @@ resource "aws_security_group_rule" "egress" {
5151 security_group_id = join (" " , aws_security_group. default . * . id )
5252}
5353# tfsec:ignore:aws-ec2-no-public-egress-sgr
54- # tfsec:ignore:aws-ec2-add-description-to-security-group-rule
5554resource "aws_security_group_rule" "egress_ipv6" {
5655 count = (var. enable_security_group == true && length (var. sg_ids ) < 1 && var. is_external == false ) && var. egress_rule == true ? 1 : 0
5756
57+ description = var. sg_egress_description
5858 type = " egress"
5959 from_port = 0
6060 to_port = 65535
6161 protocol = " -1"
6262 ipv6_cidr_blocks = [" ::/0" ]
6363 security_group_id = join (" " , aws_security_group. default . * . id )
6464}
65- # tfsec:ignore:aws-ec2-add-description-to-security-group-rule
6665resource "aws_security_group_rule" "ingress" {
6766 count = length (var. allowed_ip ) > 0 == true && length (var. sg_ids ) < 1 ? length (compact (var. allowed_ports )) : 0
6867
68+ description = var. sg_egress_description
6969 type = " ingress"
7070 from_port = element (var. allowed_ports , count. index )
7171 to_port = element (var. allowed_ports , count. index )
0 commit comments