diff --git a/infrastructure/global/domains/pyconit_dev/main.tf b/infrastructure/global/domains/pyconit_dev/main.tf new file mode 100644 index 0000000000..43c9ab8032 --- /dev/null +++ b/infrastructure/global/domains/pyconit_dev/main.tf @@ -0,0 +1,4 @@ +resource "aws_route53_zone" "pyconit_dev" { + name = "pyconit.dev" + comment = "" +} diff --git a/infrastructure/global/ecr_repos/main.tf b/infrastructure/global/ecr_repos/main.tf index d871ea7396..2277c3c424 100644 --- a/infrastructure/global/ecr_repos/main.tf +++ b/infrastructure/global/ecr_repos/main.tf @@ -5,7 +5,6 @@ locals { ] } - resource "aws_ecr_repository" "service_repo" { for_each = toset(local.services) name = "pythonit/${each.key}" diff --git a/infrastructure/global/vpc/endpoints.tf b/infrastructure/global/vpc/endpoints.tf deleted file mode 100644 index 77e7df7e12..0000000000 --- a/infrastructure/global/vpc/endpoints.tf +++ /dev/null @@ -1,8 +0,0 @@ -resource "aws_vpc_endpoint" "s3" { - vpc_id = aws_vpc.default.id - service_name = "com.amazonaws.eu-central-1.s3" - vpc_endpoint_type = "Gateway" - route_table_ids = concat( - [for route in aws_route_table.public : route.id] - ) -} diff --git a/infrastructure/global/vpc/lambda_security_group.tf b/infrastructure/global/vpc/lambda_security_group.tf deleted file mode 100644 index e0ca5a6a36..0000000000 --- a/infrastructure/global/vpc/lambda_security_group.tf +++ /dev/null @@ -1,45 +0,0 @@ -resource "aws_security_group" "lambda" { - vpc_id = aws_vpc.default.id - name = "pythonit-lambda-security-group" - description = "Lambda common security group" - - tags = { - Name = "pythonit-lambda-security-group" - } -} - -resource "aws_security_group_rule" "allow_http" { - type = "egress" - from_port = 80 - to_port = 80 - protocol = "tcp" - security_group_id = aws_security_group.lambda.id - cidr_blocks = ["0.0.0.0/0"] -} - -resource "aws_security_group_rule" "allow_https" { - type = "egress" - from_port = 443 - to_port = 443 - protocol = "tcp" - security_group_id = aws_security_group.lambda.id - cidr_blocks = ["0.0.0.0/0"] -} - -resource "aws_security_group_rule" "allow_outbound_redis" { - type = "egress" - from_port = 6379 - to_port = 6379 - protocol = "tcp" - security_group_id = aws_security_group.lambda.id - cidr_blocks = ["0.0.0.0/0"] -} - -resource "aws_security_group_rule" "allow_pyclamd" { - type = "egress" - from_port = 3310 - to_port = 3310 - protocol = "tcp" - security_group_id = aws_security_group.lambda.id - cidr_blocks = ["0.0.0.0/0"] -} diff --git a/infrastructure/global/vpc/main.tf b/infrastructure/global/vpc/main.tf deleted file mode 100644 index 6d8499d03a..0000000000 --- a/infrastructure/global/vpc/main.tf +++ /dev/null @@ -1,19 +0,0 @@ -locals { - public_azs_cidr = { - "eu-central-1a" : "10.0.1.0/24", - "eu-central-1b" : "10.0.2.0/24" - } - private_azs_cidr = { - "eu-central-1a" : "10.0.4.0/24", - "eu-central-1b" : "10.0.5.0/24" - } -} - -resource "aws_vpc" "default" { - cidr_block = "10.0.0.0/16" - enable_dns_hostnames = true - - tags = { - Name = "pythonit-vpc" - } -} diff --git a/infrastructure/global/vpc/private_subnet.tf b/infrastructure/global/vpc/private_subnet.tf deleted file mode 100644 index 5136431b2a..0000000000 --- a/infrastructure/global/vpc/private_subnet.tf +++ /dev/null @@ -1,12 +0,0 @@ -resource "aws_subnet" "private" { - for_each = local.private_azs_cidr - vpc_id = aws_vpc.default.id - availability_zone = each.key - cidr_block = each.value - - tags = { - Name = "private subnet ${each.key}" - Type = "private" - AZ = each.key - } -} diff --git a/infrastructure/global/vpc/public_subnet.tf b/infrastructure/global/vpc/public_subnet.tf deleted file mode 100644 index 00bedee100..0000000000 --- a/infrastructure/global/vpc/public_subnet.tf +++ /dev/null @@ -1,41 +0,0 @@ -resource "aws_subnet" "public" { - for_each = local.public_azs_cidr - vpc_id = aws_vpc.default.id - availability_zone = each.key - cidr_block = each.value - map_public_ip_on_launch = true - - tags = { - Name = "public subnet ${each.key}" - Type = "public" - AZ = each.key - } -} - -resource "aws_route_table" "public" { - for_each = toset(keys(local.public_azs_cidr)) - vpc_id = aws_vpc.default.id - - route { - cidr_block = "0.0.0.0/0" - gateway_id = aws_internet_gateway.default.id - } - - tags = { - Name = "public subnet route table ${each.value}" - } - - depends_on = [ - aws_internet_gateway.default - ] -} - -resource "aws_route_table_association" "public_subnet_to_public_route" { - for_each = toset(keys(local.public_azs_cidr)) - route_table_id = aws_route_table.public[each.value].id - subnet_id = aws_subnet.public[each.value].id -} - -resource "aws_internet_gateway" "default" { - vpc_id = aws_vpc.default.id -} diff --git a/infrastructure/global/vpc/rds_security_group.tf b/infrastructure/global/vpc/rds_security_group.tf deleted file mode 100644 index 702fe821f3..0000000000 --- a/infrastructure/global/vpc/rds_security_group.tf +++ /dev/null @@ -1,27 +0,0 @@ -resource "aws_security_group" "rds" { - vpc_id = aws_vpc.default.id - name = "pythonit-rds-security-group" - description = "Allow inbound postgres traffic" - - tags = { - Name = "pythonit-rds-security-group" - } -} - -resource "aws_security_group_rule" "allow_postgres" { - type = "ingress" - from_port = 5432 - to_port = 5432 - protocol = "tcp" - security_group_id = aws_security_group.rds.id - cidr_blocks = ["0.0.0.0/0"] -} - -resource "aws_security_group_rule" "allow_outbound_postgres" { - type = "egress" - from_port = 5432 - to_port = 5432 - protocol = "tcp" - security_group_id = aws_security_group.rds.id - source_security_group_id = aws_security_group.rds.id -} diff --git a/infrastructure/global/vpc/rds_subnet.tf b/infrastructure/global/vpc/rds_subnet.tf deleted file mode 100644 index f09fe48c3b..0000000000 --- a/infrastructure/global/vpc/rds_subnet.tf +++ /dev/null @@ -1,12 +0,0 @@ -resource "aws_db_subnet_group" "rds" { - name = "pythonit-rds-subnet" - description = "Pythonit rds subnet" - subnet_ids = [ - for subnet in aws_subnet.private : - subnet.id - ] - - tags = { - Name = "pythonit-rds-subnet" - } -}