Skip to content

Add missed measurements bucket #253

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 35 additions & 4 deletions tf/environments/dev/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,10 @@ resource "random_id" "artifact_id" {
byte_length = 4
}

resource "aws_s3_bucket" "ooniprobe_failed_reports" {
bucket = "ooniprobe-failed-reports-${var.aws_region}"
}

resource "aws_s3_bucket" "ooniapi_codepipeline_bucket" {
bucket = "codepipeline-ooniapi-${var.aws_region}-${random_id.artifact_id.hex}"
}
Expand Down Expand Up @@ -313,12 +317,34 @@ module "ooniapi_cluster" {

#### OONI Probe service

# For accessing the s3 bucket
resource "aws_iam_role_policy" "ooniprobe_role" {
name = "${local.name}-task-role"
role = module.ooniapi_cluster.container_host_role.name

policy = format(<<EOF
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "",
"Effect": "Allow",
"Action": "s3:PutObject",
"Resource": "%s/*"
}
]
}
EOF
, aws_s3_bucket.ooniprobe_failed_reports.arn)
}

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

service_name = "ooniprobe"
repo = "ooni/backend"
branch_name = "bg-geoip-update"
service_name = "ooniprobe"
repo = "ooni/backend"
# TODO change to master when https://github.com/ooni/backend/pull/969 is merged
branch_name = "report-to-ecs"
trigger_path = "ooniapi/services/ooniprobe/**"
buildspec_path = "ooniapi/services/ooniprobe/buildspec.yml"
codestar_connection_arn = aws_codestarconnections_connection.oonidevops.arn
Expand Down Expand Up @@ -353,6 +379,11 @@ module "ooniapi_ooniprobe" {
CLICKHOUSE_URL = data.aws_ssm_parameter.clickhouse_readonly_url.arn
}

task_environment = {
FASTPATH_URL = format("http://fastpath.%s.ooni.io:8472", local.environment)
FAILED_REPORTS_BUCKET = aws_s3_bucket.ooniprobe_failed_reports.bucket
}

ooniapi_service_security_groups = [
# module.ooniapi_cluster.web_security_group_id
]
Expand Down Expand Up @@ -455,7 +486,7 @@ module "ooni_clickhouse_proxy" {
to_port = 9200,
protocol = "tcp"
cidr_blocks = [for ip in flatten(data.dns_a_record_set.monitoring_host.*.addrs) : "${tostring(ip)}/32"]
}, {
}, {
from_port = 9100,
to_port = 9100,
protocol = "tcp"
Expand Down
4 changes: 4 additions & 0 deletions tf/modules/ecs_cluster/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,7 @@ output "web_security_group_id" {
output "container_security_group_id" {
value = aws_security_group.container_host.id
}

output "container_host_role" {
value = aws_iam_role.container_host
}