Here the security group resource with egress allowing specific outbound traffic. ----
resource “aws_security_group” “ec2-sg” {
provider = aws.Ireland
vpc_id = aws_vpc.VPC-NAME.id
description = "ec2-sg"
tags = {
Name = "ec2-sg"
Project = "TICKET"
}
egress {
description = "NS"
cidr_blocks = ["76.89.35/32"]
from_port = 3128
protocol = "TCP"
to_port = 3128
}
egress {
description = "NS"
cidr_blocks = ["0.0.0.0/0"]
from_port = 80
protocol = "TCP"
to_port = 80
}
egress {
description = "NS"
cidr_blocks = ["0.0.0.0/0"]
from_port = 443
protocol = "TCP"
to_port = 443
}
egress {
description = "NS"
from_port = 0
protocol = "ALL"
to_port = 0
security_groups = ["${aws_security_group.efs-sg.id}"]
}
egress {
description = "ALLOW ACCESS TO SEND EMAILS VIA SMTP"
cidr_blocks = ["198.19.20.25/32"]
from_port = 25
protocol = "TCP"
to_port = 25
}
egress {
description = “NS”
from_port = 3128
protocol = “TCP”
to_port = 3128
security_groups = [“${aws_security_group.nlb-sg.id}”]
}
}
Security group got created, working as expected but when I modify other scripts from my end, I do face issues, it reflects with Security group update(~) on TFC
why updates to the specific security group ?
Please help me if any changes need to be implemented from my end, Any alterations to the security group ?
Issue:
TFC - here the result: STATUS CHANGES TO UPDATE