diff --git a/infra/eip.tf b/infra/eip.tf index c91a760..a68e414 100644 --- a/infra/eip.tf +++ b/infra/eip.tf @@ -1,8 +1,8 @@ resource "aws_eip" "alpha_eip" { - instance = aws_instance.alpha.id + instance = aws_instance.atlas.id vpc = true tags = { - Name = "Alpha EIP" + Name = "Atlas EIP" } } diff --git a/infra/security-groups.tf b/infra/security-groups.tf index e8ab64e..bb53df1 100644 --- a/infra/security-groups.tf +++ b/infra/security-groups.tf @@ -1,5 +1,39 @@ # Here are general definitions for security rulesets +resource "aws_security_group" "ecs_web_ingress" { + name = "Alpha-Web-Ingress" + description = "Allow web traffic into the host" + vpc_id = aws_vpc.athens_vpc.id + ingress { + cidr_blocks = ["0.0.0.0/0"] + from_port = 443 + to_port = 443 + protocol = "tcp" + } + ingress { + cidr_blocks = ["0.0.0.0/0"] + from_port = 80 + to_port = 80 + protocol = "tcp" + } +} + +resource "aws_security_group" "base_ecs" { + vpc_id = aws_vpc.athens_vpc.id + egress { + cidr_blocks = ["0.0.0.0/0"] + from_port = 443 + to_port = 443 + protocol = "tcp" + } + egress { + cidr_blocks = ["0.0.0.0/0"] + from_port = 2049 + to_port = 2049 + protocol = "tcp" + } +} + resource "aws_security_group" "general_web_req" { name = "Athens General web server ruleset" description = "Allowing strictly web traffic"