Skip to content

Commit

Permalink
Initial infrastructure code
Browse files Browse the repository at this point in the history
  • Loading branch information
eternaltyro committed Mar 29, 2024
1 parent b6875a7 commit ef699a8
Show file tree
Hide file tree
Showing 7 changed files with 849 additions and 0 deletions.
44 changes: 44 additions & 0 deletions infra/prod-aws/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 36 additions & 0 deletions infra/prod-aws/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
README
======

This directory contains Terraform files that stand up raw-data services
on AWS. The following components are managed:

1. module.vpc - Networking components, subnets, gateways, routes
2. module.db - AWS RDS Aurora serverless database with bells and whistles.
3. resource.aws_ecs_cluster - An ECS cluster to contain the services
4. module.alb - Application load balancer for the API
5. module.alb-flower - Application load balancer for the monitoring service.
6. module.ecs-api - API containers
7. module.ecs-worker-daemon - Containers for daemon workers
8. module.ecs-worker-ondemand - Containers for on-demand workers
9. module.ecs-flower - Containers for flower: the queue monitoring service.
10. redis resources - Managed by AWS Elasticache and associated services.
11. An ECS instance (VM) running the backend service.
12. An ECS instance for SSH tunnels (jump-hosts)
13. Route53 resources for DNS mapping for the load balancers.

RUNNING TERRAFORM
=================

TBD

Variables
---------

- TBD

TODO
====

- Remove OSM app credentials from worker containers
- Event-driven scaling for workers
- ...
83 changes: 83 additions & 0 deletions infra/prod-aws/ami_lookup.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
data "aws_ami" "debian_bookworm_x86" {
most_recent = true

filter {
name = "name"
values = ["debian-12-amd64-*"]
}

filter {
name = "virtualization-type"
values = ["hvm"]
}

filter {
name = "architecture"
values = ["x86_64"]
}

owners = ["136693071363"] # Debian
}

data "aws_ami" "debian_bookworm_arm" {
most_recent = true

filter {
name = "name"
values = ["debian-12-arm64-*"]
}

filter {
name = "virtualization-type"
values = ["hvm"]
}

filter {
name = "architecture"
values = ["arm64"]
}

owners = ["136693071363"] # Debian
}

data "aws_ami" "debian_bullseye_x86" {
most_recent = true

filter {
name = "name"
values = ["debian-11-amd64-*"]
}

filter {
name = "virtualization-type"
values = ["hvm"]
}

filter {
name = "architecture"
values = ["x86_64"]
}

owners = ["903794441882"] # Debian
}

data "aws_ami" "debian_bullseye_arm" {
most_recent = true

filter {
name = "name"
values = ["debian-11-arm64-*"]
}

filter {
name = "virtualization-type"
values = ["hvm"]
}

filter {
name = "architecture"
values = ["arm64"]
}

owners = ["903794441882"] # Debian
}
Loading

0 comments on commit ef699a8

Please sign in to comment.