Code Monkey home page Code Monkey logo

bigoudi's Introduction

Cheap and scalable setup to deploy a SPA on AWS

MIT

This stack builds a setup to deploy a client side app on s3 with Cloudfront as a CDN and HTTPS using AWS Certificate Manager

Getting started

๐Ÿ”“ Before using the makefile, you need aws CLI installed and configured (aws configure --profile bigoudi) and an user-account on the AWS account of Bigoudi with enough permissions to run the update.

  • git clone [email protected]:NicolasRitouet/bigoudi.git
  • change bigoudi with your own project name
  • change bigou.di with your own domain name
  • if you don't have one, create a new AWS account
  • create a new profile for the AWS cli with your AWS account
  • modify params.json with your domain name and ARN certificate
  • make create-stack

Cost

The main goal of this stack is to be cost-efficient and easily scalable.

  • s3 costs a few cents per month for less than 1Gb
  • Cloudfront will be almost free with a limited traffic (if the traffic increases, you'll be hopefully glad to pay a few $ more)
  • Route53 Hosted Zone (0.50$ per month)
  • AWS Certificate manager creates SSL certificates for free and automatically renewd by AWS

In total, for a website with low traffic, the cost should be around 0.60$ per month.

Resources

Main stack

This template will create a stack containing the following AWS resources:

  • an S3 bucket for the logs
  • an S3 bucket for the website
  • a Cloudfront Distribution
  • an hosted Zone for bigou.di
  • a DNS record set for bigou.di
  • a DNS record set for www.bigou.di

SSL Certificate stack

A second cloudformation stack ssl.yml is available to create the SSL certificate.

It will create a wildcard certificate for bigou.di and bigoudi.com

This can be done manually or using this command: AWS_REGION=us-east-1 STACK_NAME=ssl-bigoudi STACK_FILE_NAME=ssl make create

โš ๏ธ The SSL certificate needs to be deployed in the us-east-1 region to be associated with Cloudfront.

Once the SSL certificate has been created, copy paste the ARN in the params.json file.

Use the following command to find the ARN:
AWS_REGION=us-east-1 STACK_NAME=ssl-bigoudi STACK_FILE_NAME=ssl make output

Commands

Push a new stack

make create

Update an existing stack

make update

Display stack's output

make output

Display stack's events

make watch

Create a new change-set

make create-hangeset

Describe a change-set

make describe-changeset CHANGESET-NAME=name-of-changeset

Test syntax of makefile

make test

Contribution

Feel free to send a PR.

bigoudi's People

Contributors

nicolasritouet avatar

Stargazers

 avatar

Watchers

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