Create infra

This commit is contained in:
Daniel Mason 2023-04-22 13:17:41 +12:00
parent 1bb150d44e
commit 2d32a3c4bb
Signed by: idanoo
GPG key ID: 387387CDBC02F132
9 changed files with 278 additions and 34 deletions

40
sg.tf Normal file
View file

@ -0,0 +1,40 @@
# Security groups to access database1.apse2
resource "aws_security_group" "sg" {
name = "status.fediservices.nz"
description = "status.fediservices.nz"
vpc_id = aws_vpc.vpc.id
}
# Allow out
resource "aws_security_group_rule" "allow_egress" {
security_group_id = aws_security_group.sg.id
type = "egress"
from_port = 0
to_port = 0
protocol = "-1"
cidr_blocks = ["0.0.0.0/0"]
ipv6_cidr_blocks = ["::/0"]
}
# Allow HTTP traffic
resource "aws_security_group_rule" "http" {
security_group_id = aws_security_group.sg.id
type = "ingress"
from_port = 80
to_port = 80
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
ipv6_cidr_blocks = ["::/0"]
}
# Allow HTTPS traffic
resource "aws_security_group_rule" "https" {
security_group_id = aws_security_group.sg.id
type = "ingress"
from_port = 443
to_port = 443
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
ipv6_cidr_blocks = ["::/0"]
}