Giter VIP home page Giter VIP logo

simple-site's Introduction

S2 - Simple Site

Static website hosted on AWS S3 with high availability (HA) and content distribution network (CDN)

Objective

It's pretty common that when you starts your project you want to tell eveyone about your awesome idea, but in general your budget is reduced. In general good ideas could be shown with a fancy static HTML sites.

The current market is dominated by Wordpress which is an excellent content editor with tons of plugins and useful features, but the content sent to the browser is, in general, generated on the fly by PHP. This affects the page's load time and forces you to put that into a webserver wich in general is more expensive than having the HTML files on an object storage.

AWS S3 is an unexpensive object repository that could be used to store HTML, css, js and assets as images or videos. And Cloudfront is a really good CDN that combined with S3 is a perfect way to serve your static corporative site.

Setup

The infrastructure setup is pretty simple. It's composed by cloudfront and S3. The infrastructure deployment is automatized using Terraform with basic security checks on the terraform code provided by trivy as part of a pre-commit set of hooks.

Setup

Cost caluclations

The monthly infrastructure costs were calculated having the following data as example:

  • Bucket size: ~1343Mb
  • Average page size: 1376.2Kb
  • Number of pages: 1000
  • Average requests per month: 50000
  • Region: us-east-1
  • Regions that consumes the website: US, Europe, South America

With the data provided above we can obtain an estimation similar to this one: https://calculator.aws/#/estimate?id=9ad857c6ac63f748272895c709213116905fd5a3

An aproximate cost of $2.88 per year!!

This does not includes the services:

  • Web Application Firewall (WAF): as it's an static site, the application does not requires any protection because the content is static. Eventually it could be enabled to mitigate DDoS attacks.
  • Cloudwatch: site access logging is not required. You count with more interesting tools to have access information like Google Analytics.
  • KMS: the S3 bucket does not requires to be encrypted because all information in the bucket is public.
  • S3 Versioning: S3 versioning is disabled because the evolution of changes on the website could be stored on a source control management like github, and the content deployment could be automatically conducted by a CI/CD tool.

simple-site's People

Contributors

alecavallo 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.