Creating the S3 bucket
- Log into AWS at https://aws.it.umich.edu
- Go to S3 and click on Create bucket
- Name your bucket as <INSERT_NAME_HERE>.michigandaily.com
- The AWS region should be US East (Ohio) us-east-2
- Under the “Block Public Access settings for this bucket” section, uncheck “Block all public access”
- A warning will appear underneath. Check the box that asks for your acknowledgement
- Click “Create bucket”
- Click into <INSERT_NAME_HERE>.michigandaily.com and click on the “Permissions” tab
- Click on the “Edit” button in the “Bucket policy” section
- Paste the following into the “Policy” box:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PublicReadGetObject",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::<INSERT_NAME_HERE>.michigandaily.com/*"
}
]
}
- Click on the “Save changes” button
- Note that “Permissions overview” will now say the S3 bucket has public access.
- Click on the “Properties” tab
- Click on the “Edit” button in the “Static website hosting” section
- Click on the “Enable” radio button
- Type
index.html
in the “Index document” field - Type
index.html
in the “Error document” field
- This will redirect any routes that error out to
index.html
- You may want to redirect to another page depending on the nature of the website
- Go to the “Objects” tab and upload your production-ready build files
Creating the CloudFront distribution
- Go to CloudFront and click the “Create distribution” button
- In the “Origin domain” field, type
<INSERT_NAME_HERE>.michigandaily.com.s3-website.us-east-2.amazonaws.com
- In the “Default cache behavior” section, select “Redirect HTTP to HTTPS” for the “Viewer protocol policy” option
- In the “Settings” section, select “Use only North America and Europe” for the “Price class” option
- Click the “Add item” button under the “Alternate domain name (CNAME)” option. Type <INSERT_NAME_HERE>.michigandaily.com
- Choose the
*.michigandaily.com
ACM certificate for the “Custom SSL certificate” option - Type
index.html
for the “Default root object” field - Click the “Create distribution” button
- Wait for the distribution to deploy. This may take several minutes.
- Make note of the “Distribution domain name”
Creating a new domain record with Route 53
- Go to Route 53 and click on “Hosted zones” underneath “DNS management”
- Click on the michigandaily.com zone
- Click the “Create record” button
- Type <INSERT_NAME_HERE> in the “Record name” field
- Turn on the “Alias” switch next to the “Value” field
- In the dropdown, pick the “Alias to CloudFront distribution” option
- Type the “Distribution domain name” that we made a note of from CloudFront
- Click the “Create records” button
Go to <INSERT_NAME_HERE>.michigandaily.com and verify that your static site is working.