Skip to content

Commit 8f78952

Browse files
authored
chore: add rate-limited testnet rpc client (#24836)
2 parents e72da93 + 9ee6101 commit 8f78952

1 file changed

Lines changed: 18 additions & 5 deletions

File tree

  • spartan/terraform/deploy-rpc/environments/testnet

spartan/terraform/deploy-rpc/environments/testnet/main.tf

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,17 +72,30 @@ locals {
7272
})
7373
}
7474

75+
# Consumers listed here get no per-minute cap (rate_limit_minute = 0). Consumers that need a
76+
# finite cap go in rate_limited_consumers instead, since this loop hardcodes 0 for every entry.
7577
consumer_secret_names = [
7678
"testnet-rpc-consumer-client1"
7779
]
7880

79-
consumers = {
80-
for name in local.consumer_secret_names : name => {
81-
username = name
82-
gcp_secret_manager_secret_name = name
83-
rate_limit_minute = 0
81+
rate_limited_consumers = {
82+
"testnet-rpc-consumer-client2" = {
83+
username = "testnet-rpc-consumer-client2"
84+
gcp_secret_manager_secret_name = "testnet-rpc-consumer-client2"
85+
rate_limit_minute = 3000
8486
}
8587
}
88+
89+
consumers = merge(
90+
{
91+
for name in local.consumer_secret_names : name => {
92+
username = name
93+
gcp_secret_manager_secret_name = name
94+
rate_limit_minute = 0
95+
}
96+
},
97+
local.rate_limited_consumers
98+
)
8699
}
87100

88101
module "environment" {

0 commit comments

Comments
 (0)