Skip to content

Commit d617490

Browse files
committed
add sg
1 parent 2e983ba commit d617490

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
resource "aws_security_group" "allow_sftp_egress" {
2+
name = "${local.csi}-sftp-egress"
3+
vpc_id = module.vpc.vpc_id
4+
description = "Security group for allowing outbound traffic to SFTP"
5+
6+
tags = {
7+
Name = "${local.csi}-sftp-egress"
8+
}
9+
}
10+
11+
#tfsec:ignore:aws-ec2-no-public-egress-sgr
12+
resource "aws_security_group_rule" "allow_sftp_egress_ssh" {
13+
description = "Allow SFTP egress within VPC on port 22"
14+
type = "egress"
15+
from_port = 22
16+
to_port = 22
17+
protocol = "tcp"
18+
cidr_blocks = ["0.0.0.0/0"]
19+
security_group_id = aws_security_group.allow_sftp_egress.id
20+
}
21+
22+
#tfsec:ignore:aws-ec2-no-public-egress-sgr
23+
resource "aws_security_group_rule" "allow_sftp_egress_https" {
24+
description = "Allow SFTP egress within VPC on port 443"
25+
type = "egress"
26+
from_port = 443
27+
to_port = 443
28+
protocol = "tcp"
29+
cidr_blocks = ["0.0.0.0/0"]
30+
security_group_id = aws_security_group.allow_sftp_egress.id
31+
}

0 commit comments

Comments
 (0)