File tree Expand file tree Collapse file tree 2 files changed +23
-5
lines changed Expand file tree Collapse file tree 2 files changed +23
-5
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,15 @@ resource "aws_db_subnet_group" "public" {
16
16
# All of this security group stuff should go away once we migrate bastion to the
17
17
# prod vpc (vs. the legacy vpc).
18
18
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
+
19
28
data "aws_security_group" "bastion" {
20
29
vpc_id = data. terraform_remote_state . shared . outputs . prod_vpc . id
21
30
name = " rust-prod-bastion"
@@ -43,11 +52,13 @@ resource "aws_security_group" "rust_prod_db" {
43
52
}
44
53
45
54
ingress {
46
- from_port = 5432
47
- to_port = 5432
48
- protocol = " tcp"
49
- cidr_blocks = [" 159.69.58.186/32" ]
50
- description = " Connections from rustc-perf collection server"
55
+ from_port = 5432
56
+ to_port = 5432
57
+ protocol = " tcp"
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"
51
62
}
52
63
53
64
tags = {
Original file line number Diff line number Diff line change @@ -17,3 +17,10 @@ resource "aws_route53_record" "one" {
17
17
records = [" 144.76.186.39" ]
18
18
ttl = 300
19
19
}
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
+ }
You can’t perform that action at this time.
0 commit comments