🚀 Production-Ready CloudFront Distribution
This is a complete, enterprise-grade CloudFront setup demonstrating all advanced features and best practices.
Multi-Origin
S3 + API Gateway + Failover
Security
WAF + OAC + Lambda@Edge
Performance
Origin Shield + HTTP/2 + Gzip
Global
200+ Edge Locations
Advanced Features Enabled
Origin Configuration
- ✅ Primary S3 bucket (${website_url})
- ✅ Failover S3 bucket (multi-region)
- ✅ API Gateway backend
- ✅ Origin Access Control (OAC)
- ✅ Origin Shield enabled
Performance Optimization
- ✅ HTTP/2 and IPv6 support
- ✅ Gzip compression enabled
- ✅ Optimized cache policies
- ✅ Static assets: 1 year TTL
- ✅ API responses: 5 min TTL
Security & Compliance
- ✅ AWS WAF integration
- ✅ HTTPS redirect enforced
- ✅ Security headers via Lambda@Edge
- ✅ Geographic restrictions
- ✅ Field-level encryption ready
Monitoring & Logging
- ✅ CloudWatch real-time logs
- ✅ S3 access log delivery
- ✅ Custom error pages
- ✅ Performance monitoring
- ✅ Comprehensive outputs
Distribution Testing
Static Assets Test
This CSS and JS are served from S3 with 1-year cache headers.
API Integration Test
Test API routing through CloudFront with no caching.
Error Page Test
Test custom error page handling.
Cache Headers
Inspect cache-related headers from CloudFront.
Infrastructure Information
Project: ${project}
Environment: ${environment}
Website URL: ${website_url}
Distribution: ${distribution_name}