Setting up Instant Websites on AWS for self hosting
Setting up your AWS environment
There are a couple of things you will need to do before Instant Websites is ready to publish to your AWS s3 bucket. Your AWS s3 bucket will need to be configured for static web hosting, and an account will need to be configured with the correct IAM policies.
Configuring your S3 bucket for Instant Websites
You will need to first create a bucket. Be sure to create your bucket name as per your desired domain name.
Example: If your domain is to be docs.acme.com, then your bucket name should be docs.acme.com
This is essential for securing your site with SSL.
Creating a bucket with the default settings should be fine.
After creating your bucket, you will need to configure it for static website hosting:
- Navigate to S3 in the AWS Console.
- Click into your bucket.
- Click the Properties section.
- Click the Static website hosting option.
- Select Use this bucket to host a website.
- Enter index.html as the Index document page.
- Enter error.html as the error document page.
You will need to also configure your bucket with permissions required for public website access.
- Navigate to S3 in the AWS console.
- Select your bucket.
- Select Edit public access settings.
- Clear block all public access, and click save.
Configuring your AWS account for Instant Websites
It is recommended to set up a new separate account and give that access to your s3 bucket.
- Navigate to IAM in the AWS console.
- Select Users
- Select Add User
- Enter a User name and check Programmatic access, then click Next: Permissions
Selecting Programmatic access ensures that AWS generates your API access keys.
- As part of the account creation process, you will be required to add policy permissions. To run Instant Websites you will need to add certain permissions and access from your account to your s3 bucket.
- If you are confident working with S3 buckets you can use the Attach existing policies directly option and add in the AmazonS3FullAccess policy, which will give your account ample access to your s3 bucket.
- If your goal is to simply generate and upload your site to your s3 bucket, creating your own policy may be prudent and you will only require the following policy actions:
- After attaching your policy, click Next: Review
- On the final step of the account creation process, ensuring you've selected programmatic access in Step 4, your access key ID and secret access key should be displayed. Be sure to note down and save these values before navigating away from the page. They will be required for setting up your Instant Website connection.