Skip to content

fix: expose the lighthouse queue redis over PrivateLink#598

Closed
otsybizov wants to merge 1 commit intomainnet-stagingfrom
fix/carto-redis-connection
Closed

fix: expose the lighthouse queue redis over PrivateLink#598
otsybizov wants to merge 1 commit intomainnet-stagingfrom
fix/carto-redis-connection

Conversation

@otsybizov
Copy link
Contributor

🤖 Linear

Closes CONG-XXX

Copilot AI review requested due to automatic review settings March 18, 2026 14:57
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Exposes the staging “lighthouse queue” Redis to the backend VPC via AWS PrivateLink, and updates the BullMQ Redis URL parsing to support TLS SNI overrides needed when connecting through a PrivateLink endpoint DNS name.

Changes:

  • Add tlsServername URL query support in parseRedisUrl() and tune Redis connection defaults for BullMQ usage.
  • Introduce reusable Terraform PrivateLink modules: a provider-side internal NLB + endpoint service, and a consumer-side interface endpoint + SG.
  • Wire the staging core VPC (provider) and staging backend VPC (consumer) together and update REDIS_URL to use the endpoint DNS with SNI override.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/adapters/mqclient/src/index.ts Adds SNI override support via ?tlsServername= and sets Redis connection defaults.
ops/modules/privatelink/provider/variables.tf Inputs for the provider-side NLB + endpoint service module.
ops/modules/privatelink/provider/main.tf Creates internal NLB targeting resolved IPs and exposes it as a VPC Endpoint Service.
ops/modules/privatelink/provider/outputs.tf Exposes endpoint service name and NLB ARN for consumers/visibility.
ops/modules/privatelink/consumer/variables.tf Inputs for the consumer-side interface endpoint module.
ops/modules/privatelink/consumer/main.tf Provisions interface endpoint + SG to reach the provider’s endpoint service.
ops/modules/privatelink/consumer/outputs.tf Outputs DNS name/id for clients to connect to the interface endpoint.
ops/mainnet/staging/core/main.tf Adds provider module instantiation for lighthouse queue Redis.
ops/mainnet/staging/core/outputs.tf Exposes endpoint service name and Redis connection pieces for backend remote-state consumption.
ops/mainnet/staging/backend/main.tf Adds consumer module instantiation in backend VPC.
ops/mainnet/staging/backend/config.tf Updates REDIS_URL to use PrivateLink endpoint DNS + tlsServername.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -0,0 +1,9 @@
output "endpoint_dns_name" {
description = "DNS name of the VPC endpoint — use as the host for cross-VPC clients"
value = aws_vpc_endpoint.this.dns_entry[0].dns_name
Comment on lines +4 to +10
# Service endpoints are typically DNS names; resolve to IP for the NLB target group.
# NOTE: IPs are resolved at apply-time. If the target service changes IPs
# (e.g. ElastiCache failover), a re-apply is needed to update NLB targets.
# Consider scheduling periodic re-applies or alerting on target health.
data "dns_a_record_set" "target" {
host = var.target_address
}
{ name = "DD_API_KEY", value = var.dd_api_key },
{ name = "CARTOGRAPHER_ADMIN_TOKEN", value = var.cartographer_admin_token },
{ name = "REDIS_URL", value = data.terraform_remote_state.core.outputs.lighthouse_queue_redis_url },
{ name = "REDIS_URL", value = "rediss://:${data.terraform_remote_state.core.outputs.lighthouse_queue_redis_auth_token}@${module.lighthouse_queue_privatelink.endpoint_dns_name}:${data.terraform_remote_state.core.outputs.lighthouse_queue_redis_port}?tlsServername=${data.terraform_remote_state.core.outputs.lighthouse_queue_redis_address}" },
@otsybizov otsybizov closed this Mar 18, 2026
@otsybizov otsybizov deleted the fix/carto-redis-connection branch March 18, 2026 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants