Skip to content

Commit

Permalink
Fix reference to shared security group
Browse files Browse the repository at this point in the history
  • Loading branch information
hellais committed Mar 11, 2024
1 parent 1c92020 commit 82eec4e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 34 deletions.
4 changes: 4 additions & 0 deletions tf/environments/dev/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,10 @@ module "ooniapi_frontend" {
oonibackend_proxy_target_group_arn = module.ooni_backendproxy.alb_target_group_id
oonidataapi_target_group_arn = module.oonidataapi.alb_target_group_id

ooniapi_service_security_groups = [
module.ooniapi_cluster.web_security_group_id
]

stage = local.stage
dns_zone_ooni_io = local.dns_zone_ooni_io

Expand Down
35 changes: 1 addition & 34 deletions tf/modules/ooniapi_frontend/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,43 +2,10 @@ locals {
name = "ooni-tier0-api-frontend"
}

resource "aws_security_group" "ooniapi" {
description = "controls access to the application ELB"

vpc_id = var.vpc_id
name = "${local.name}-sg"

ingress {
protocol = "tcp"
from_port = 80
to_port = 80
cidr_blocks = ["0.0.0.0/0"]
}

ingress {
protocol = "tcp"
from_port = 443
to_port = 443
cidr_blocks = ["0.0.0.0/0"]
}

egress {
from_port = 0
to_port = 0
protocol = "-1"

cidr_blocks = [
"0.0.0.0/0",
]
}

tags = var.tags
}

resource "aws_alb" "ooniapi" {
name = local.name
subnets = var.subnet_ids
security_groups = [aws_security_group.ooniapi.id]
security_groups = var.ooniapi_service_security_groups

tags = var.tags
}
Expand Down
5 changes: 5 additions & 0 deletions tf/modules/ooniapi_frontend/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,8 @@ variable "dns_zone_ooni_io" {
variable "stage" {
description = "dev, test, prod label for the stage"
}

variable "ooniapi_service_security_groups" {
description = "the shared web security group from the ecs cluster"
type = list(string)
}

0 comments on commit 82eec4e

Please sign in to comment.