Skip to content

Commit

Permalink
Merge pull request #609 from rust-lang/allow-bastion2-to-access-crater
Browse files Browse the repository at this point in the history
allow bastion2 to access crater
  • Loading branch information
MarcoIeni authored Oct 8, 2024
2 parents d3b6911 + e183bf4 commit c7f16b0
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions terraform/crater/instance.tf
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ data "dns_a_record_set" "bastion" {
host = "bastion.infra.rust-lang.org"
}

data "dns_a_record_set" "bastion2" {
host = "bastion2.infra.rust-lang.org"
}

resource "aws_security_group" "crater" {
vpc_id = data.terraform_remote_state.shared.outputs.prod_vpc.id
name = "rust-prod-crater"
Expand Down Expand Up @@ -88,6 +92,28 @@ resource "aws_security_group" "crater" {
}
}

dynamic "ingress" {
for_each = toset(data.dns_a_record_set.bastion2.addrs)
content {
from_port = 22
to_port = 22
protocol = "tcp"
cidr_blocks = ["${ingress.value}/32"]
description = "SSH from the bastion"
}
}

dynamic "ingress" {
for_each = toset(data.dns_a_record_set.bastion2.addrs)
content {
from_port = -1
to_port = -1
protocol = "icmp"
cidr_blocks = ["${ingress.value}/32"]
description = "ICMP from the bastion"
}
}

// node_exporter access from the monitoring instance
dynamic "ingress" {
for_each = toset(data.dns_a_record_set.monitoring.addrs)
Expand Down

0 comments on commit c7f16b0

Please sign in to comment.