Question

I have my Route 53 setup as follows

company.com A [EB Load Balancer]

www.company.com A [S3 Bucket]

S3 setup Redirect all requests to another host name: company.com

I know I'm just not understanding something, but I can't wrap my head around having all S3 links go through company.com instead of company.com.s3-website-us-west-2.amazonaws.com

Was it helpful?

Solution

If your goal is to server assets (images, JS, css, etc) from within an S3 bucket, but using a custom DNS hostname, you can do the following:

  • Create an S3 bucket matching your intended hostname: assets.mycompany.com
  • Setup a DNS CNAME record for assets.mycompany.com in Route 53 => assets.mycompany.com.s3.amazonaws.com

This will allow you to load a file like http;//assets.mycompany.com/foo.jpg

Full documentation for S3 usage this way can be found here: http://docs.aws.amazon.com/AmazonS3/latest/dev/VirtualHosting.html

If you need to serve S3/CloudFront content from your Apex aka "naked" domain (mycompany.com), you can configure an ALIAS record in Route 53 pointing at your S3 bucket or CloudFront host.

http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/CreatingAliasRRSets.html

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top