- Newest
- Most votes
- Most comments
Yes, you can use an Application Load Balancer (ALB) to forward traffic to on-premises servers via Site-to-Site VPN and Transit Gateway. Here's how this would work for your specific scenario:
-
Yes, you can register on-premises private IPs as ALB targets using target type = IP, as long as there's network connectivity between the ALB and those targets via your Site-to-Site VPN. The main caveat is that you need to ensure proper routing between your VPC and on-premises network. The ALB must be able to reach the on-premises targets for both health checks and actual traffic forwarding. Also, be aware that traffic crossing the VPN will incur data transfer charges and may introduce additional latency compared to targets within AWS.
-
The ALB doesn't "point to" TGW/VGW directly. Instead, the ALB forwards traffic to the target IPs, and the VPC routing tables determine how that traffic reaches those IPs. Your VPC route tables need to have entries that direct traffic destined for your on-premises network ranges through the Transit Gateway or Virtual Private Gateway. The TGW/VGW provides the routing infrastructure, but the ALB simply sends traffic to IP addresses.
-
For security configurations:
- On the AWS side: The ALB's security group needs to allow outbound traffic to your on-premises IP ranges on the required ports (typically 80/443 for web servers).
- The VPC security groups should allow traffic from the ALB's security group to flow to the Transit Gateway.
- On-premises: Your firewall should allow inbound traffic from the AWS VPC CIDR ranges on the required ports. You should also ensure your on-premises servers accept traffic from the ALB's IP ranges.
- Consider limiting access to only the necessary ports and protocols required for your application.
- For DNS cutover best practices:
- Use a CNAME record pointing to the ALB's DNS name rather than an A record.
- Before cutover, reduce the DNS TTL to a low value (e.g., 60 seconds) to allow for quick rollback if needed.
- Consider implementing a phased approach: start by directing a small percentage of traffic to the ALB while monitoring for issues.
- Have a rollback plan ready - keep your existing proxy running until you're confident the ALB setup is working properly.
- After successful cutover and validation, you can increase the TTL back to a normal value.
- Test the rollback procedure before the actual cutover to ensure it works as expected.
This architecture is a common pattern for extending AWS services to on-premises resources, allowing you to leverage AWS's managed load balancing capabilities while maintaining your existing on-premises infrastructure.
Sources
Active-Active VPN Site-to-Site Configuration to AWS | AWS re:Post
AWS hybrid connectivity services - Hybrid Connectivity
AWS Transit Gateway + AWS Site-to-Site VPN - Amazon Virtual Private Cloud Connectivity Options
answered a year ago
You can use an ALB to forward traffic to on-premises servers over a Site-to-Site VPN/TGW. In addition to the automated answer, here are some additional considerations beyond the standard setup:
Cost Implications
Traffic from AWS to on-prem over a VPN incurs data transfer charges (VPC → VPN → on-prem). High-volume traffic can significantly impact your costs, so plan accordingly.
Site-to-Site VPN Bandwidth Limits
Standard AWS VPN tunnels support up to ~1.25 Gbps per tunnel. For higher throughput or redundancy, consider multiple tunnels in parallel or using AWS Direct Connect.
Security Hardening
For added protection, consider putting an AWS WAF in front of the ALB. WAF can block common web attacks, enforce rate limits, and restrict traffic to only allowed IP ranges before requests reach on-prem servers.
Remember that WAF only inspects traffic entering the ALB from the Internet; once traffic traverses the VPN, it's already past WAF.
DNS Cutover Best Practices
In addition to reducing TTL and using a CNAME to the ALB:
- Watch for propagation delays from some recursive resolvers.
- Ensure session persistence is handled correctly if your application uses login sessions.
- Monitor metrics (latency, errors, dropped connections) on both the old proxy and the ALB during cutover.
- Prepare rollback carefully: the old proxy must handle sudden spikes if DNS reversions occur.
References:
answered a year ago
Relevant content
asked 4 years ago
