Search code examples
amazon-web-servicesamazon-ec2cdn

AWS CDN for single EC2 instance


As per the title, is it possible to apply Amazon CloudFront to a single EC2 instance without creating 2 instances in different available zones? (it'd be too expensive to pay for two instances)


Solution

  • You can create a CloudFront distribution in front of a single EC2 instance. Your EC2 instance needs a public IP address. When you create the CloudFront distribution, make sure to use the public IPv4 DNS name of your instance as origin, because IP addresses are not allowed as origin name.