- Newest
- Most votes
- Most comments
Yes, there are several benefits to fronting your ALB with CloudFront even if you don't need caching for static content:
- Security improvements:
- CloudFront acts as the first point of contact for incoming requests and has access to the original client IP addresses, making WAF more effective when deployed at the CloudFront level
- You can restrict ALB access to only CloudFront IP addresses using security groups with managed prefix lists
- You can add custom headers from CloudFront to ALB to ensure traffic only comes through your CloudFront distribution
- Performance benefits:
- Lower latency between users and your application by leveraging AWS's global edge network
- Persistent connections to your application - CloudFront maintains connections to your ALB, reducing the need to establish new TCP/TLS connections
- Ability to serve content over modern protocols like HTTP/3 or TLS1.3, even if your application doesn't support them
- Cost efficiency:
- Potential cost reduction with CloudFront's Always Free tier (1TB of data per month)
- Lower data transfer costs compared to regional resources like ALBs
- Reduced ALB capacity requirements due to fewer new and active connections
- Additional capabilities:
- Response header manipulation (like removing "Server: awselb/2.0" headers)
- CloudFront Functions for request/response manipulation at the edge
- Better protection against DDoS attacks with integrated AWS Shield and WAF at the edge
AWS has recently announced a new one-click integration that makes it easier to attach a CloudFront distribution directly from the ALB console, simplifying the setup process.
For dynamic content, you can use CloudFront with a "CachingDisabled" cache policy to ensure requests always go to your origin while still benefiting from the other advantages.
Sources
WAF on ALB or CloudFront ? | AWS re:Post
How to use AWS WAF to prevent "awselb/2.0" server information exposure in HTTP response header? | AWS re:Post
AWS Application Load Balancer announces CloudFront integration with built-in WAF - AWS
Building resilient and secure game backends with Amazon CloudFront | AWS for Games Blog
AWS Proxy Architecture with Global Accelerator, ALB, WAF, etc. | AWS re:Post
Relevant content
asked 4 years ago
asked 2 years ago
- AWS OFFICIALUpdated 2 years ago
