Search code examples
amazon-web-servicesamazon-cloudfrontaws-alb

possibility to use S3 as CDN for internal Application load balancer ( ALB) applications


For public websites, we have an option cloudfront as CDN for static content when we use internet-facing application load balancers. Is there any similar option for internal websites using private ALB ?

Web application is implemented in ExpressJs with all static files served from server, but no clues on how to proceed on separating these static assets to move to any CDN as its a not public and cant use cloudfront for private ELB. Any ideas ?


Solution

  • Unfortunately No, You can't use Internal ALB/ELB with CloudFront, it needs to be a public endpoint, however, now that you can have lambda as target for Application load balancers, you can write a lambda function to fetch files from S3 for you.

    https://aws.amazon.com/blogs/networking-and-content-delivery/lambda-functions-as-targets-for-application-load-balancers/