Skip to content

Commit

Permalink
Add findings deployment to prod
Browse files Browse the repository at this point in the history
* Fix calling of the backend frontend module in prod
  • Loading branch information
hellais committed Sep 13, 2024
1 parent 99cd52d commit 3998063
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 18 deletions.
20 changes: 10 additions & 10 deletions tf/environments/dev/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -253,16 +253,16 @@ module "ooni_backendproxy" {

stage = local.environment

vpc_id = module.network.vpc_id
subnet_id = module.network.vpc_subnet_public[0].id
private_subnet_cidr = module.network.vpc_subnet_private[*].cidr_block
dns_zone_ooni_io = local.dns_zone_ooni_io
vpc_id = module.network.vpc_id
subnet_id = module.network.vpc_subnet_public[0].id
private_subnet_cidr = module.network.vpc_subnet_private[*].cidr_block
dns_zone_ooni_io = local.dns_zone_ooni_io

key_name = module.adm_iam_roles.oonidevops_key_name
instance_type = "t2.micro"

backend_url = "https://backend-hel.ooni.org/"
clickhouse_url = "backend-fsn.ooni.org"
backend_url = "https://backend-hel.ooni.org/"
clickhouse_url = "backend-fsn.ooni.org"
clickhouse_port = "9000"

tags = merge(
Expand Down Expand Up @@ -536,10 +536,10 @@ module "ooniapi_frontend" {
vpc_id = module.network.vpc_id
subnet_ids = module.network.vpc_subnet_public[*].id

oonibackend_proxy_target_group_arn = module.ooni_backendproxy.alb_target_group_id
ooniapi_oonirun_target_group_arn = module.ooniapi_oonirun.alb_target_group_id
ooniapi_ooniauth_target_group_arn = module.ooniapi_ooniauth.alb_target_group_id
ooniapi_ooniprobe_target_group_arn = module.ooniapi_ooniprobe.alb_target_group_id
oonibackend_proxy_target_group_arn = module.ooni_backendproxy.alb_target_group_id
ooniapi_oonirun_target_group_arn = module.ooniapi_oonirun.alb_target_group_id
ooniapi_ooniauth_target_group_arn = module.ooniapi_ooniauth.alb_target_group_id
ooniapi_ooniprobe_target_group_arn = module.ooniapi_ooniprobe.alb_target_group_id
ooniapi_oonifindings_target_group_arn = module.ooniapi_oonifindings.alb_target_group_id

ooniapi_service_security_groups = [
Expand Down
74 changes: 66 additions & 8 deletions tf/environments/prod/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -257,12 +257,21 @@ moved {
module "ooni_backendproxy" {
source = "../../modules/ooni_backendproxy"

vpc_id = module.network.vpc_id
subnet_ids = module.network.vpc_subnet_public[*].id
stage = local.environment

vpc_id = module.network.vpc_id
subnet_id = module.network.vpc_subnet_public[0].id

private_subnet_cidr = module.network.vpc_subnet_private[*].cidr_block
dns_zone_ooni_io = local.dns_zone_ooni_io

key_name = module.adm_iam_roles.oonidevops_key_name
instance_type = "t2.micro"

backend_url = "https://backend-fsn.ooni.org/"
clickhouse_url = "backend-fsn.ooni.org"
clickhouse_port = "9000"

tags = merge(
local.tags,
{ Name = "ooni-tier0-backendproxy" }
Expand Down Expand Up @@ -417,6 +426,54 @@ module "ooniapi_oonirun" {
)
}

#### OONI Findings service

module "ooniapi_oonifindings_deployer" {
source = "../../modules/ooniapi_service_deployer"

service_name = "oonifindings"
repo = "ooni/backend"
branch_name = "master"
buildspec_path = "ooniapi/services/oonifindings/buildspec.yml"
codestar_connection_arn = aws_codestarconnections_connection.oonidevops.arn

codepipeline_bucket = aws_s3_bucket.ooniapi_codepipeline_bucket.bucket

ecs_service_name = module.ooniapi_oonifindings.ecs_service_name
ecs_cluster_name = module.ooniapi_cluster.cluster_name
}

module "ooniapi_oonifindings" {
source = "../../modules/ooniapi_service"

vpc_id = module.network.vpc_id
public_subnet_ids = module.network.vpc_subnet_public[*].id
private_subnet_ids = module.network.vpc_subnet_private[*].id

service_name = "oonifindings"
default_docker_image_url = "ooni/api-oonifindings:latest"
stage = local.environment
dns_zone_ooni_io = local.dns_zone_ooni_io
key_name = module.adm_iam_roles.oonidevops_key_name
ecs_cluster_id = module.ooniapi_cluster.cluster_id

task_secrets = {
POSTGRESQL_URL = aws_secretsmanager_secret_version.oonipg_url.arn
JWT_ENCRYPTION_KEY = aws_secretsmanager_secret_version.jwt_secret.arn
PROMETHEUS_METRICS_PASSWORD = aws_secretsmanager_secret_version.prometheus_metrics_password.arn
}

ooniapi_service_security_groups = [
module.ooniapi_cluster.web_security_group_id
]

tags = merge(
local.tags,
{ Name = "ooni-tier0-oonifindings" }
)
}


#### OONI Auth service

module "ooniapi_ooniauth_deployer" {
Expand Down Expand Up @@ -494,10 +551,11 @@ module "ooniapi_frontend" {
vpc_id = module.network.vpc_id
subnet_ids = module.network.vpc_subnet_public[*].id

oonibackend_proxy_target_group_arn = module.ooni_backendproxy.alb_target_group_id
ooniapi_oonirun_target_group_arn = module.ooniapi_oonirun.alb_target_group_id
ooniapi_ooniauth_target_group_arn = module.ooniapi_ooniauth.alb_target_group_id
ooniapi_ooniprobe_target_group_arn = module.ooniapi_ooniprobe.alb_target_group_id
oonibackend_proxy_target_group_arn = module.ooni_backendproxy.alb_target_group_id
ooniapi_oonirun_target_group_arn = module.ooniapi_oonirun.alb_target_group_id
ooniapi_ooniauth_target_group_arn = module.ooniapi_ooniauth.alb_target_group_id
ooniapi_ooniprobe_target_group_arn = module.ooniapi_ooniprobe.alb_target_group_id
ooniapi_oonifindings_target_group_arn = module.ooniapi_oonifindings.alb_target_group_id

ooniapi_service_security_groups = [
module.ooniapi_cluster.web_security_group_id
Expand Down Expand Up @@ -584,9 +642,9 @@ module "codesigning" {
module "ansible_controller" {
source = "../../modules/ansible_controller"

vpc_id = module.network.vpc_id
vpc_id = module.network.vpc_id
subnet_id = module.network.vpc_subnet_public[0].id
key_name = module.adm_iam_roles.oonidevops_key_name
key_name = module.adm_iam_roles.oonidevops_key_name

dns_zone_ooni_io = local.dns_zone_ooni_io
}

0 comments on commit 3998063

Please sign in to comment.