Giter VIP home page Giter VIP logo

s3-domain-parking's Introduction

AWS S3 Domain Parking

This project creates an S3 bucket that is configured to host a static website with CORS enabled. All you have to do is to configure the project and create a CNAME record in your domain.

Prerequisites

  1. AWS free tier account;
  2. Programmatic access to AWS account with the following permissions: s3:PutObject, s3:PutBucketWebsite, s3:GetBucketWebsite, s3:GetBucketCORS, s3:PutBucketAcl, s3:CreateBucket, s3:ListBucket, s3:PutBucketCORS, s3:GetBucketAcl, s3:HeadBucket, s3:PutObjectAcl.
  3. Access to Domain management (Namecheap, GoDaddy, etc.);
  4. Google Analytics account (optional).
  5. Node.js and npm installed.

Limitations

Because of the way S3 static website hosting works, it is not possible to create a CNAME record of the top level of your domain. Therefore, you can park (subdomain).domain.com (e.g www.domain.com). Having said that, some DNS providers (Namecheap) allow redirecting the top level domain to a subdomain. See question here.

Configuration

Before your parking page is ready, please make sure to configure it for your needs. All configuration lays inside config.json:

{
    "trackingId": "",
    "domainName": "",
    "innerHtml": "Coming soon...",
    "accessKeyId": "",
    "secretAccessKey": "",
    "awsRegion": "us-east-1",
    "showRibbon": true|false
}

All fields are mandatory unless stated otherwise.

  • trackingId: Google Analytics Tracking ID (see below how to obtain). This is property is optional - if not defined, tracking will be deactivated.
  • domainName: The domain name which will be shown on your parking page.
  • innerHtml: The HTML/text which will appear under the domain name.
  • accessKeyId: AWS Access Key ID (see below how to obtain).
  • secretAccessKey: AWS Secret Key (see below how to obtain).
  • awsRegion: AWS region. Defaults to us-east-1 and doesn't really matter for our use-case, still required by aws-sdk.
  • showRibbon: Display the ribbon at the top of the page (thanks to fork-me-on-github-retina-ribbons!).

Obtaining Google Analytics Tracking ID

Instructions

Deploy to S3

To deploy your parking page, open terminal and run:

  1. npm install
  2. npm run deploy
  3. When the process completes, create a CNAME record, as shown on the screen.

You're all set! Visit your domain to verify the landing page works. Please note that it might take some time for some DNS service providers to update your domain records.

s3-domain-parking's People

Contributors

cadriel avatar levz0r avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.