How to set subdomain with s3 and cloudflare? - amazon-web-services

I want to assign http://remo.babylook.mom/ on s3 bucket http://babylook-remo.s3-website-us-west-1.amazonaws.com.
I set Cloudflare like this tho,
I got this error.
Code: NoSuchBucket
Message: The specified bucket does not exist
BucketName: remo.babylook.mom
RequestId: 8F85DEC6EA4AB692
HostId: T7Mikx7Fj7fBMJhSbSVDjelX0BGkK87QY40BnTdH0Ga2wqt6c8C/s+LTChQ90uehEV3KmtkxMU4=
Do you know how to set this? I can see s3 website normally with s3 address. And also, I'm using http://babylook.mom/ and working well.

You'll have to add the following record:
Name: http://remo.babylook.mom/
Value/Target: http://babylook-remo.s3-website-us-west-1.amazonaws.com/
Type: CNAME

Related

CloudFront: The specified bucket does not exist

I have a static website hosted on S3 which works fine when accessed through my bucket's endpoint. However, when I create a CloudFront distribution and try access it through using the CloudFront domain I keep getting the error below.
d1xu3mknlk0sbd.cloudfront.net
Code: NoSuchBucket
Message: The specified bucket does not exist
BucketName: d1xu3mknlk0sbd.cloudfront.net
RequestId: 656B653A2ED5B2B1
HostId: 9etNAX1XEJmbVKUAMylBDz3xEky+7RhAnr9b8HhpkIb9+pkMnn920v/MSAUjr78oyONEUdlba50=
I have set up my CloudFront origin domain name to the s3 url of my static site which works when I type it in the browser so why can't CloudFront find the bucket ...
Ended up solving this by changing my s3 bucket name from 'sample' to 'www.sample.com' .Strangely CloudFront started resolving the correct bucket name. Why this works remains a mystery ...

AWS Route53 + S3 static website gives an error: alias target name does not lie within the target zone

I have registered a domain using Route53 and created a S3 bucket for my website.
Assume the following:
Route53 hosted zone is: domain.com
S3 bucket name is: staging.domain.com
Using the Route53 console I then attempted to create new record to point to my S3 bucket with the following settings:
Record name: staging.domain.com
Value/Route traffic to: Alias to S3 website endpoint
Region: (from drop-down) Africa(Cape Town)[af-south-1]
Choose S3 bucket: (from drop-down) s3-website.af-south-1.amazonaws.com (staging.domain.com)
Record type: A
After clicking on create records I am greeted with the following error:
**Error occurred
Bad request.**
(InvalidChangeBatch 400: Tried to create an alias that targets s3-website.af-south-1.amazonaws.com., type A in zone Z11KHD8FBVPUYU, but the alias target name does not lie within the target zone)
In my mind the alias target is supposed to be staging.domain.com.s3-website.af-south-1.amazonaws.com
not s3-website.af-south-1.amazonaws.com
For completeness sake I have 2 other A records listed on this domain:
dev.domain.com -> Pointing to an EC2 instance (working)
test.domain.com -> Pointing to a CloudFront distribution (working)
Any idea why this is happening or how it can be corrected?
I think drop down you are getting is correct.
See this screenshot :
New Console UI has different feature. First you have to select as region then bucket selection.
Check if you are following same seeting then you should not get error. Also one more check whether S3 bucket is enable for website hosting or not.

Create a Cloudfront Distribution that Origin is an S3 bucket using ansible playbook

I am using Ansible Playbook to push to an S3 bucket, and then use Cloudfront distribution to serve the site over https.
I would like to implement this using Ansible Playbook, however I haven't been able to configure the task correctly. I'm not sure where to specify the S3 Origin of the bucket?
- cloudfront_distribution:
comment: 'description'
enabled: yes
state: present
default_root_object: index.html
validate_certs: yes
viewer_certificate:
acm_certificate_arn: {arn of certificate}
alias: {www.mydomain.com}
origins:
- id: 'id'
s3_origin_access_identity_enabled: yes
Where can I specific the S3 bucket that I would like to serve through Cloudfront?
I've tried using the origins to specify the URL of the S3 bucket. But so far I have only been getting errors.
Would anyone be able to help me to specifiy the S3 bucket location so that I can serve the site through S3?
It appears that the module is expecting domain_name: to be of the form my-awesome-bucket.s3.amazonaws.com which triggers the magic s3 sauce, and that should cause your s3_origin_access_identity_enabled: yes to take effect.
If you find that to be the case, it might be worth filing an issue to have them update the documentation to be a little clearer.

aws - browse to website - 404 not found - no such bucket

I have created a record set for my webiste volcalc.io and www.volcalc.io which is stored in an s3 bucket.
When I try to browse to the website I see this error:
404 Not Found
Code: NoSuchBucket
Message: The specified bucket does not exist
BucketName: volcalc.io
RequestId: xxx
HostId: xxx
The bucket name is www.volcalc.io, not volcalc.io
How do I change it to make it look for bucket named www.volcalc.io?
See Setting Up a Static Website Using a Custom Domain.
To allow requests for both example.com and www.example.com, you need to create two buckets even though you will host content in only one of them. You will need to configure the other bucket to redirect requests to the bucket that hosts the content.

What URL should I use for Amazon CloudFront content?

This has also been posted in the AWS forum. But it's languishing a bit (and I'm in a hurry to solve this problem).
This question is with regard to a 'download' distribution, not 'streaming'.
I've recently signed up and created an Amazon S3 bucket and then created an Amazon CloudFront (CF) distribution out of that bucket. Here's the relevant info:
Bucket Name: stella_media
Folder In Bucket: visia
Which results in a working URL (with public-read access) like this: http://s3.amazonaws.com/stella_media/visia/720_125M_Zero_Dark_Thirty.mp4
So you'll see that if you use the above URL (and you're not using Firefox) it loads the MP4 video. All the media in my bucket is set to public-read.
My Problem Is With Access To The Same Content Via Cloudfront:
And my CF distrubution has the following properties:
Delivery Method: download
Distribution Status: deployed
Price Class: US & Europe
State: Enabled
Domain Name: d2322fq9z81lph.cloudfront.net
However, when I use the URL provided to me when I setup my CF distribution on that bucket I get a "noSuchKey" error: http://d2322fq9z81lph.cloudfront.net/stella_media/visia/720_125M_Zero_Dark_Thirty.mp4
<Error>
<Code>NoSuchKey</Code>
<Message>The specified key does not exist.</Message>
<Key>stella_media/visia/720_125M_Zero_Dark_Thirty.mp4</Key>
<RequestId>5E2FA36884444757</RequestId>
<HostId>
HiphTLuv4P2tiJemBRNvIGsq8DRbSCMocdAvm4oto9NVnnKNHuDZWuFHz+xyCt6B
</HostId>
</Error>
So ... exactly what URL am I supposed to be using to point to my video OR is there some sort of permissions setting that I've overlooked to make the content in my CF distribution public?
Thanks for any help.
For the benefit of any others that may come across this, I've figured this out.
Apparently CloudFront URL's DO NOT INCLUDE THE BUCKET NAME. So it would play out like so:
S3 URL
http://s3.amazonaws.com/stella_media/visia/720_125M_Zero_Dark_Thirty.mp4
CloudFront URL
http://d2322fq9z81lph.cloudfront.net/visia/720_125M_Zero_Dark_Thirty.mp4
Hopefully that helps anyone else from going out of their mind trying to figure out what's wrong.