A. Select: Static Website hosting (https://docs.aws.amazon.com/AmazonS3/latest/dev/EnableWebsiteHosting.html)
B. Note the URL at the top of that setting (your-domain.net.s3-website.eu-west-2.amazonaws.com)
C. Set Permissions using JSON (https://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteAccessPermissionsReqd.html)
{
"Version":"2012-10-17",
"Statement":[{
"Sid":"PublicReadGetObject",
"Effect":"Allow",
"Principal": "*",
"Action":["s3:GetObject"],
"Resource":["arn:aws:s3:::example-bucket/*"
]
}
]
}Note: example-bucket should be replaced with your bucket name.
A. Note: Region must be `N Virginia` to be able to import later
B. Add both domains in the request `*.your-domain.net` and `your-domain.net`
Important: The Origin must match the S3 bucket Web site URL (1.B. above)
A. Edit the CloudFront Distribution
- Set Alternate Domains as `www.your-domain.net, your-domain.net`
- Select: Custom SSL Certificate and pick corresponding from the drop down below
B. Edit Origins settings
- Set Origin Domain Name to the static Website URL hosting setting in S3 (see 1.B. above)
A. Create a Record with the following:
- Name: `www.your-domain.net`,
- Type: `A - IPv4 address`,
- Alias: `Yes`,
- Target: `<CLIUDFRONTID>.cloudfront.net`,
- Routing policy: `Simple`
B. Create a Record with the following:
- name: `your-domain.net`,
- Type: `CNAME`,
- Alias: `No`, TTL: `300`[default],
- Value: `<CLIUDFRONTID>.cloudfront.net`,
- Routing policy: `Simple`
NOTE: Step 4.B. did not work due to existing SOA record with your-domain.net. For that an Alias type record was created simillar to 4.A.