05 Secure with HTTPS - AWS
Categories:
2 minute read
To create an AWS Cloud Front service, in the AWS portal find the Cloud Front service and select Create Distribution
.
For the Origin
, which is essentially the source the CDN will use to feed its caches, choose the S3 website endpoint on the URL http://{BUCKET NAME}.s3-website-{REGION}.amazonaws.com
. If you browse and choose the S3 bucket then it will prompt you to use the website endpoint dynamically.
For this purpose we’ll skip the origin path
.
For the Name
leave it as deafult for now. The following pages will explain how we can use CNAME (DNS alias) to allow us to use our own domain name in-front of the Cloud Front service on the public URL.
Again, for ths purpose, skip header
.
Enabling Origin Shield
is optional and will incur costs. For this small scale setup it’s not required.
Under the Viewer
section, enable the HTTPS only
option to ensure that Cloud Front URLs are HTTPS only.
All other options can be left as-is.
Click Create Distribution
and monitor the status in the portal. This could take 10-20 minutes to deploy.
Under the properties of the service is the Distribution Domain Name
. This is the Cloud Front URL which will look something like this https://d1n6xxjjrymahi.cloudfront.net
. Once the CDN caches are update with your origin, this URL should serve your website on an HTTPS connection.
Status
At this stage, you have an AWS S3 static website being used as an origin for AWS Cloud Front CDN services which is accessible over the default AWS URL of
https://{NAME}.cloudfront.net