Skip to content

fix: expose the lighthouse queue redis over PrivateLink#597

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

fix: expose the lighthouse queue redis over PrivateLink#597
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:31
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

This PR exposes the lighthouse queue Redis from the “core” VPC to the “backend” VPC via AWS PrivateLink, and updates the BullMQ Redis URL parsing to support TLS SNI overrides when connecting through a PrivateLink DNS name.

Changes:

  • Extend parseRedisUrl to support ?tlsServername=... and standardize Redis connection timeouts/retry options.
  • Add reusable Terraform PrivateLink modules (provider NLB + endpoint service, consumer interface endpoint).
  • Wire the new modules into ops/mainnet/staging core/backend stacks and update REDIS_URL to use the PrivateLink endpoint with correct SNI.

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 TLS SNI override support and Redis connection tuning for BullMQ connections.
ops/modules/privatelink/provider/variables.tf Defines inputs for the provider-side PrivateLink module.
ops/modules/privatelink/provider/main.tf Creates internal NLB + target group + endpoint service for exposing a TCP target over PrivateLink.
ops/modules/privatelink/provider/outputs.tf Exposes endpoint service name (and NLB ARN) for consumers.
ops/modules/privatelink/consumer/variables.tf Defines inputs for the consumer-side endpoint module.
ops/modules/privatelink/consumer/main.tf Creates interface endpoint + security group for consuming the provider service.
ops/modules/privatelink/consumer/outputs.tf Exposes endpoint DNS name/id to be used by clients.
ops/mainnet/staging/core/main.tf Instantiates the provider module to expose lighthouse queue Redis via PrivateLink.
ops/mainnet/staging/core/outputs.tf Exports service name/port/auth/address needed by backend via remote state.
ops/mainnet/staging/backend/main.tf Instantiates the consumer module in the backend VPC.
ops/mainnet/staging/backend/config.tf Switches REDIS_URL to use the PrivateLink endpoint DNS + tlsServername override.

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

Comment on lines +5 to +14
resource "aws_security_group" "endpoint" {
name = "pl-endpoint-${var.environment}-${var.stage}-${var.family}"
description = "Allow traffic to PrivateLink endpoint for ${var.family}"
vpc_id = var.vpc_id

ingress {
from_port = var.port
to_port = var.port
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
Comment on lines +44 to +45
target_group_arn = aws_lb_target_group.this.arn
target_id = data.dns_a_record_set.target.addrs[0]
Comment on lines +4 to +7
# Service endpoints are typically DNS names; resolve to IP for the NLB target group.
data "dns_a_record_set" "target" {
host = var.target_address
}
@otsybizov otsybizov closed this Mar 18, 2026
@otsybizov otsybizov deleted the fix/carto-redis-connection branch March 18, 2026 14:55
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