Skip to content

Commit 3664fbe

Browse files
committed
allow rustc-perf collection server to access bastion
1 parent 8b4dbbf commit 3664fbe

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

terraform/rds-databases/instance.tf

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,15 @@ resource "aws_db_subnet_group" "public" {
1616
# All of this security group stuff should go away once we migrate bastion to the
1717
# prod vpc (vs. the legacy vpc).
1818

19+
data "terraform_remote_state" "rustc_perf" {
20+
backend = "s3"
21+
config = {
22+
bucket = "rust-terraform"
23+
key = "simpleinfra/rustc-perf.tfstate"
24+
region = "us-west-1"
25+
}
26+
}
27+
1928
data "aws_security_group" "bastion" {
2029
vpc_id = data.terraform_remote_state.shared.outputs.prod_vpc.id
2130
name = "rust-prod-bastion"
@@ -46,8 +55,10 @@ resource "aws_security_group" "rust_prod_db" {
4655
from_port = 5432
4756
to_port = 5432
4857
protocol = "tcp"
49-
cidr_blocks = ["159.69.58.186/32"]
50-
description = "Connections from rustc-perf collection server"
58+
cidr_blocks = [
59+
for ip in data.terraform_remote_state.rustc_perf.outputs.rustc_perf_ips : "${ip}/32"
60+
]
61+
description = "Connections from rustc-perf collection servers"
5162
}
5263

5364
tags = {

terraform/rustc-perf/dns.tf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,10 @@ resource "aws_route53_record" "one" {
1717
records = ["144.76.186.39"]
1818
ttl = 300
1919
}
20+
21+
output "rustc_perf_ips" {
22+
value = [
23+
tolist(aws_route53_record.legacy.records)[0],
24+
tolist(aws_route53_record.one.records)[0]
25+
]
26+
}

0 commit comments

Comments
 (0)