Skip to content

Latest commit

 

History

History
69 lines (53 loc) · 1.76 KB

File metadata and controls

69 lines (53 loc) · 1.76 KB

Deployment

Recreating the Deployment Target on S3

Here are the steps to create the cloud setup on S3 in case you need to recreate it, or you want to use a similar setup for your own website.

The site is hosted as a static site on AWS/S3.

To (re-)create the S3 bucket setup in the eu-central-1 region, run the following:

Prerequisites:

  • aws-cli
  • aws credentials that allow you to create and manage S3 buckets

Create the bucket:

aws s3api create-bucket --bucket <bucket-name> --region eu-central-1 --create-bucket-configuration LocationConstraint=eu-central-1

Allow policies to set public access:

aws s3api put-public-access-block --bucket <bucket-name> --public-access-block-configuration "BlockPublicPolicy=false"

Check that the settings are correct:

aws s3api get-bucket-ownership-controls --bucket <bucket-name>

Allow public read through policy.

aws s3api put-bucket-policy --bucket <bucket-name> --policy '{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "PublicReadGetObject",
            "Effect": "Allow",
            "Principal": "*",
            "Action": [
                "s3:GetObject"
            ],
            "Resource": [
                "arn:aws:s3:::'<bucket-name>'/*"

            ]
        }
    ]
}'

Copy website to s3:

aws s3 cp tmp s3://<bucket-name>/ --recursive

Set index:

aws s3 website s3://<bucket-name> --index-document index.html

Confirm the results:

curl <bucket-name>.s3-website.eu-central-1.amazonaws.com

AWS provides in-depth guides on how to setup SSL and your domain, check it out on the buckets' page: https://eu-central-1.console.aws.amazon.com/s3/buckets/?region=eu-central-1&bucketType=general&tab=properties