diff --git a/infra/eip.tf b/infra/eip.tf new file mode 100644 index 0000000..433c3dd --- /dev/null +++ b/infra/eip.tf @@ -0,0 +1,9 @@ +# Beta will basically always be the static web server +# hence why we explicitly setup an EIP for it alone like this +resource "aws_eip" "beta_eip" { + instance = aws_instance.beta.id + vpc = true + tags = { + Name = "Beta Elastic IP" + } +} diff --git a/infra/gateway.tf b/infra/gateway.tf new file mode 100644 index 0000000..e4418d5 --- /dev/null +++ b/infra/gateway.tf @@ -0,0 +1,7 @@ +resource "aws_internet_gateway" "athens_gateway" { + vpc_id = aws_vpc.athens_vpc.id + + tags = { + Name = "Athens Common Internet Gateway" + } +} diff --git a/infra/route-table.tf b/infra/route-table.tf new file mode 100644 index 0000000..9765d0f --- /dev/null +++ b/infra/route-table.tf @@ -0,0 +1,15 @@ +resource "aws_route_table" "crete_route_table" { + vpc_id = aws_vpc.athens_vpc.id + route { + cidr_block = var.crete_cidr + gateway_id = aws_internet_gateway.athens_gateway.id + } + tags = { + Name = "Crete Route Table" + } +} + +resource "aws_route_table_association" "crete_gateway_association" { + subnet_id = aws_subnet.crete_subnet.id + route_table_id = aws_route_table.crete_route_table.id +}