Skip to content

Peso255/ikebukuro

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Ikebukuro

1 S3 bucket, 1 CloudFront distribution, 100 sites.

Launch Stack


Hosting many static landing pages/websites? Tired of doing the same rigmarole on NGINX/S3/CloudFront when setting a new one? This is for you.

  • Launch Stack.
  • Put website files on S3.
  • Profit.

What to have

What to do

  • Click "Launch Stack" at the top. Click "Next".
  • Change the Stack Name if you want. Fill in parameters:
    • CertArn: ARN of certificate from ACM.
      • Make sure to create it in the us-east-1 region!
    • ServedDomains: Domains to serve. Separate multiple domains with commas.
      • example.com != www.example.com
    • SyncUserArn: ARN of users with read/write access to S3 bucket. Separate multiple users with commas.
  • "Next", "Next", "Create Stack".
  • Once stack creation is complete, load in website and error page files on the created S3 bucket.
    • AWS console, aws s3 cp or aws s3 sync.
    • Put files for each domain in its own folder (e.g. /example.com/index.htm for example.com).
    • Put 404 error (only error I have right now) page design on /error/404.htm.

What to know

  • Stack must be launched on us-east-1 region. Lambda@Edge requirements.
  • No server-side content, since the files are hosted in S3.
    • Client-side JS and an API can provide server-side content.
  • The index page of a folder is index.htm only.
    • Documents w/o an extension (e.g. folder/doc) won't redirect to the index page (e.g. folder/doc/index.htm).
  • The same error page design applies to all websites.
    • CloudFront wipes request headers when returning a request to origin for the error document.
    • If you know how to bypass this wipe, tweet me or open a pull request!
  • Stack deletions will not work the first time.
    • Lambda won't let you delete functions until their caches have been removed from all CloudFront edges.
    • Let it fail, wait at least 1 hour, try deleting again. It'll work after some time.

Contributing

Pull Requests, Issues, you know the deal.

About

1 S3 bucket, 1 CloudFront distribution, 100 sites.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published