Coder Social home page Coder Social logo

s3-cloudfront-hosting's Introduction

Webhosting with S3 and Cloudfront

This is a project for deploying the infrastructure to host a static website with Amazon Cloudfront and Amazon S3

We'll be using CDK for creating our infrastructure.

First, make sure you clone this project

$git clone https://github.com/gmansilla/s3-cloudfront-hosting.git && cd s3-cloudfront-hosting

This project is set up like a standard Python project. The initialization process also creates a virtualenv within this project, stored under the .venv directory. To create the virtualenv it assumes that there is a python3 (or python for Windows) executable in your path with access to the venv package. If for any reason the automatic creation of the virtualenv fails, you can create the virtualenv manually.

To manually create a virtualenv on MacOS and Linux:

$ python3 -m venv .venv

After the init process completes and the virtualenv is created, you can use the following step to activate your virtualenv.

$ source .venv/bin/activate

If you are a Windows platform, you would activate the virtualenv like this:

% .venv\Scripts\activate.bat

Once the virtualenv is activated, you can install the required dependencies.

$ pip install -r requirements.txt

Prior to deploying, we need to bootstrap CDK

$cdk bootstrap

And we're ready to deploy!

$cdk deploy

Pay attention to the Output of this command as this will tell you the URL of your new website.

The URL should be next to s3-cloudfront.CloudFrontWebDistribution

Destroying the stack

After you experiment with this project, you should delete the contents of your buckets (and any versions of objects) and run $cdk destroy Note: this command will attempt to destroy all components created and can fail if you still have objects in your buckets.

Enjoy!

s3-cloudfront-hosting's People

Contributors

gmansilla avatar

Watchers

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