shouldautomate.it

Distribute

  • npm install
  • grunt

Install

Host on S3

  • Setup static page on S3

    • Properties -> Static website hosting

      • Index document: index.html

      • Error document: error.html

      • Redirect rule: (see 1, 2 for subpages eg. Hugo)

        <RoutingRules>
        <RoutingRule>
            <Condition>
            <KeyPrefixEquals>/</KeyPrefixEquals>
            </Condition>
            <Redirect>
            <ReplaceKeyWith>index.html</ReplaceKeyWith>
            </Redirect>
        </RoutingRule>
        </RoutingRules>
        
    • Bucket policy

      {
          "Version": "2012-10-17",
          "Statement": [
              {
                  "Sid": "PublicReadGetObject",
                  "Effect": "Allow",
                  "Principal": "*",
                  "Action": [
                      "s3:GetObject"
                  ],
                  "Resource": [
                      "arn:aws:s3:::shouldiautomate.it/*"
                  ]
              }
          ]
      }
      
    • Deploy user policy

      {
      "Version": "2012-10-17",
      "Statement": [
          {
          "Effect": "Allow",
          "Action": [
              "s3:ListBucket",
              "s3:GetBucketLocation"
          ],
          "Resource": ["arn:aws:s3:::shouldiautomate.it"]
          },
          {
          "Effect": "Allow",
          "Action": [
              "s3:GetObject",
              "s3:GetObjectAcl",
              "s3:PutObject",
              "s3:PutObjectAcl",
              "s3:DeleteObject"
          ],
          "Resource": ["arn:aws:s3:::shouldiautomate.it/*"]
          }
      ]
      }
      

Host on Cloudfront

  • CloudFront as CDN inkl. TLS, 2, 3, 4

    • Provision certificate

      • Switch region "N. Virgina"
      • Open Amazon Certificate Manager (ACM)
      • Request a certificate (from Amazon for free - similar to Lets encrypt)
      • Validate certificate (eg. using CNAME)
    • Create new distribution

      • Select "Web"
      • Point origin to http://BUCKET_NAME.s3-website-REGION_NAME.amazonaws.com and not the bucket directly! (See 1, 2)
      • Redirect HTTP to HTTPS
      • Allow GET, HEAD
      • Object Caching Customize + Max and Default TTL 1800 (aka 30 min)
      • Compress Objects Automatically
      • Price Class "Use Only U.S...." (Cheapest)
      • Alternate Domain Names (CNAMEs) -> Enter your naked domain aka shouldiautomate.it
      • Custom SSL certificate from ACM dropdown
      • Only Clients .. SNI
      • TLSv1.1
      • HTTP/2 support
      • Default Root Object index.html
      • Create and wait...
      • Select distribution and Error Pages tab add link to your error page
    • Hint: If you want to protect your origin and use OAI you can still redirect to subpages uses Lambdas see this.

Content

Improve SEO

Email

  • Receive emails via SES

Gimmick