diff --git a/tf/environments/dev/main.tf b/tf/environments/dev/main.tf index 3b73e21e..7809b94b 100644 --- a/tf/environments/dev/main.tf +++ b/tf/environments/dev/main.tf @@ -226,17 +226,6 @@ resource "aws_secretsmanager_secret_version" "oonipg_url" { ) } -resource "aws_secretsmanager_secret" "ooniclickhouse_url" { - name = "oonidevops/ooni-tier0-clickhouse/clickhouse_url" - tags = local.tags -} - -// TODO(decfox): replace with working ooniclickhouse_url -resource "aws_secretsmanager_secret_version" "ooniclickhouse_url" { - secret_id = aws_secretsmanager_secret.ooniclickhouse_url.id - secret_string = "" -} - resource "random_id" "artifact_id" { byte_length = 4 } @@ -304,7 +293,7 @@ module "ooni_backendproxy" { backend_url = "https://backend-hel.ooni.org/" wcth_addresses = module.ooni_th_droplet.droplet_ipv4_address wcth_domain_suffix = "th.dev.ooni.io" - clickhouse_url = "backend-fsn.ooni.org" + clickhouse_url = "backend-hel.ooni.org" clickhouse_port = "9000" tags = merge( @@ -422,11 +411,14 @@ module "ooniapi_oonimeasurements" { ecs_cluster_id = module.ooniapi_cluster.cluster_id task_secrets = { - CLICKHOUSE_URL = aws_secretsmanager_secret_version.ooniclickhouse_url.arn JWT_ENCRYPTION_KEY = aws_secretsmanager_secret_version.jwt_secret.arn PROMETHEUS_METRICS_PASSWORD = aws_secretsmanager_secret_version.prometheus_metrics_password.arn } + task_environment = { + CLICKHOUSE_URL = "backend-hel.ooni.org" + } + ooniapi_service_security_groups = [ module.ooniapi_cluster.web_security_group_id ] @@ -621,6 +613,7 @@ module "ooniapi_frontend" { 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_oonimeasurements_target_group_arn = module.ooniapi_oonimeasurements.alb_target_group_id ooniapi_service_security_groups = [ module.ooniapi_cluster.web_security_group_id diff --git a/tf/modules/ooniapi_frontend/main.tf b/tf/modules/ooniapi_frontend/main.tf index c72937a2..dd6e428b 100644 --- a/tf/modules/ooniapi_frontend/main.tf +++ b/tf/modules/ooniapi_frontend/main.tf @@ -200,4 +200,42 @@ resource "aws_lb_listener_rule" "ooniapi_oonifindings_rule_host" { values = ["oonifindings.${local.direct_domain_suffix}"] } } -} \ No newline at end of file +} + +resource "aws_lb_listener_rule" "ooniapi_oonifindings_rule" { + listener_arn = aws_alb_listener.ooniapi_listener_https.arn + priority = 140 + + action { + type = "forward" + target_group_arn = var.ooniapi_oonimeasurements_target_group_arn + } + + condition { + path_pattern { + values = [ + "/api/v1/measurements/*", + "/api/v1/raw_measurement", + "/api/v1/measurement_meta", + "/api/v1/measurements", + "/api/v1/torsf_stats", + "/api/v1/aggregation" + ] + } + } +} + +resource "aws_lb_listener_rule" "ooniapi_oonifindings_rule_host" { + listener_arn = aws_alb_listener.ooniapi_listener_https.arn + priority = 141 + + action { + type = "forward" + target_group_arn = var.ooniapi_oonimeasurements_target_group_arn + } + condition { + host_header { + values = ["oonimeasurements.${local.direct_domain_suffix}"] + } + } +} diff --git a/tf/modules/ooniapi_frontend/variables.tf b/tf/modules/ooniapi_frontend/variables.tf index 10d9bef7..1def4fe8 100644 --- a/tf/modules/ooniapi_frontend/variables.tf +++ b/tf/modules/ooniapi_frontend/variables.tf @@ -32,6 +32,10 @@ variable "ooniapi_oonifindings_target_group_arn" { description = "arn for the target group of the oonifindings service" } +variable "ooniapi_oonimeasurements_target_group_arn" { + description = "arn for the target group of the oonimeasurements service" +} + variable "dns_zone_ooni_io" { description = "id of the DNS zone for ooni_io" }