-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from DNXLabs/feature/security-group
Include security group for Network load balancer
- Loading branch information
Showing
4 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
resource "aws_security_group" "nlb" { | ||
name = "ecs-${var.name}-nlb" | ||
description = "SG for network load balancer" | ||
vpc_id = var.vpc_id | ||
|
||
tags = { | ||
Name = "ecs-${var.name}-nlb" | ||
} | ||
} | ||
|
||
resource "aws_security_group_rule" "nlb_from_internet" { | ||
description = "Traffic from Internet" | ||
type = "ingress" | ||
from_port = 1194 | ||
to_port = 1194 | ||
protocol = "-1" | ||
security_group_id = aws_security_group.nlb.id | ||
cidr_blocks = ["0.0.0.0/0"] | ||
} | ||
|
||
resource "aws_security_group_rule" "nlb_to_internet" { | ||
description = "Traffic to internet" | ||
type = "egress" | ||
from_port = 1194 | ||
to_port = 1194 | ||
protocol = "-1" | ||
security_group_id = aws_security_group.nlb.id | ||
cidr_blocks = ["0.0.0.0/0"] | ||
} | ||
|