All Projects → jonls → S3 Deploy Website

jonls / S3 Deploy Website

Licence: mit
Deploy website to S3/CloudFront from Python

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to S3 Deploy Website

Scar
Deploy static websites in seconds - with HTTPS, a global CDN, and custom domains.
Stars: ✭ 1,715 (+6496.15%)
Mutual labels:  aws, s3, static-site, cloudfront
Discharge
⚡️ A simple, easy way to deploy static websites to Amazon S3.
Stars: ✭ 483 (+1757.69%)
Mutual labels:  aws, s3, static-site
Workshop Donkeytracker
Workshop to build a serverless tracking application for your mobile device with an AWS backend
Stars: ✭ 27 (+3.85%)
Mutual labels:  aws, s3, cloudfront
Confetti
🎉 A tool to help creating and deploying static sites with AWS
Stars: ✭ 96 (+269.23%)
Mutual labels:  s3, static-site, cloudfront
simply-static-deploy
WordPress plugin to deploy static sites easily to an AWS S3 bucket.
Stars: ✭ 48 (+84.62%)
Mutual labels:  s3, static-site, cloudfront
React Deploy S3
Deploy create react app's in AWS S3
Stars: ✭ 66 (+153.85%)
Mutual labels:  aws, s3, cloudfront
Aws
A collection of bash shell scripts for automating various tasks with Amazon Web Services using the AWS CLI and jq.
Stars: ✭ 493 (+1796.15%)
Mutual labels:  aws, s3, cloudfront
Terraform Aws Cloudfront S3 Cdn
Terraform module to easily provision CloudFront CDN backed by an S3 origin
Stars: ✭ 162 (+523.08%)
Mutual labels:  aws, s3, cloudfront
Lad
👦 Lad is the best Node.js framework. Made by a former Express TC and Koa team member.
Stars: ✭ 2,112 (+8023.08%)
Mutual labels:  aws, s3, cloudfront
Github To S3 Lambda Deployer
⚓️ GitHub webhook extension for uploading static pages to AWS S3 directly after commiting to master via Lambda written in Node.js
Stars: ✭ 23 (-11.54%)
Mutual labels:  aws, s3, static-site
S3mock
A simple mock implementation of the AWS S3 API startable as Docker image, JUnit 4 rule, or JUnit Jupiter extension
Stars: ✭ 332 (+1176.92%)
Mutual labels:  aws, s3
Vue Cli Plugin S3 Deploy
A vue-cli plugin that uploads your built Vue.js project to an S3 bucket
Stars: ✭ 304 (+1069.23%)
Mutual labels:  aws, s3
Aws.s3
Amazon Simple Storage Service (S3) API Client
Stars: ✭ 302 (+1061.54%)
Mutual labels:  aws, s3
Cloudfrunt
A tool for identifying misconfigured CloudFront domains
Stars: ✭ 281 (+980.77%)
Mutual labels:  aws, cloudfront
Nodb
NoDB isn't a database.. but it sort of looks like one.
Stars: ✭ 353 (+1257.69%)
Mutual labels:  aws, s3
Cloudfront Auth
An AWS CloudFront [email protected] function to authenticate requests using Google Apps, Microsoft, Auth0, OKTA, and GitHub login
Stars: ✭ 471 (+1711.54%)
Mutual labels:  aws, cloudfront
S3 Sync Action
🔄 GitHub Action to sync a directory with a remote S3 bucket 🧺
Stars: ✭ 497 (+1811.54%)
Mutual labels:  aws, s3
Fluent Plugin S3
Amazon S3 input and output plugin for Fluentd
Stars: ✭ 276 (+961.54%)
Mutual labels:  aws, s3
Moto
A library that allows you to easily mock out tests based on AWS infrastructure.
Stars: ✭ 5,428 (+20776.92%)
Mutual labels:  aws, s3
S3 Benchmark
Measure Amazon S3's performance from any location.
Stars: ✭ 525 (+1919.23%)
Mutual labels:  aws, s3

Deploy static website to S3/CloudFront

.. image:: https://travis-ci.org/jonls/s3-deploy-website.svg?branch=master :alt: Build Status :target: https://travis-ci.org/jonls/s3-deploy-website

.. image:: https://badge.fury.io/py/s3-deploy-website.svg :alt: PyPI badge :target: http://badge.fury.io/py/s3-deploy-website

.. image:: https://coveralls.io/repos/jonls/s3-deploy-website/badge.svg?branch=master&service=github :alt: Test coverage :target: https://coveralls.io/github/jonls/s3-deploy-website?branch=master

This is a deployment tool for uploading static websites to S3. If CloudFront is used for hosting the website, the uploaded files can be automatically invalidated in the CloudFront distribution. A prefix tree is used to minimize the number of invalidations since only a limited number of free invalidations are available per month.

The configuration is stored in a YAML file like this:

.. code-block:: yaml

site: _site
s3_bucket: example.com
cloudfront_distribution_id: XXXXXXXXXXX

cache_rules:
  - match: "/assets/*"
    maxage: 30 days

  - match_regexp: '^assets/image-\d{3}-.*\.png$'
    maxage: 90 days

  - match: "/css/*"
    maxage: 30 days

  - match: "*"
    maxage: 1 hour

The site is the directory of the static website relative to the location of the configuration file. For example, Jekyll will generate the static site in the _site directory as specified above. If you save the configuration file as .s3_website.yaml you can simply run s3-deploy-website from the same directory:

.. code-block:: shell

$ cd jekyll-site/
$ ls .s3_website.yaml
.s3_website.yaml
$ s3-deploy-website

Credentials

AWS credentials can be provided through the environment variables AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY.

.. code-block:: shell

$ export AWS_ACCESS_KEY_ID=XXXXXX
$ export AWS_SECRET_ACCESS_KEY=XXXXXX
$ s3-deploy-website

They can also be provided through the various configuration files that boto_ reads.

.. _boto: https://boto3.readthedocs.io/en/latest/guide/configuration.html

Configuration file

site The directory of the static content to be uploaded (relative to the location of the configuration file (e.g. _site for Jekyll sites).

s3_bucket The name of the S3 bucket to upload the files to. You have to allow the actions s3:GetObject, s3:PutObject, s3:DeleteObject and s3:ListBucket on the bucket and the keys e.g. arn:aws:s3:::example.com and arn:aws:s3:::example.com/*.

s3_reduced_redundancy An optional boolean to indicate whether the files should be uploaded to reduced redundancy_ storage.

cloudfront_distribution_id The CloudFront distribution to invalidate after uploading new files. Only files that were changed will be invalidated. You have to allow the action cloudfront:CreateInvalidation.

cache_rules A list of rules to determine the cache configuration of the uploaded files. The match key specifies a pattern that the rule applies to. This uses glob-style matching (with * and ?). Matching can also be performed with regular expressions by using match_regexp. Only the first rule to match a given key will be used. The maxage key specifies the time to cache the file. The value should be either a number of seconds or a string like 30 days, 5 minutes, 30 seconds, etc.

endpoint_url (Optional) For setting custom endpoint for boto3: Boto3 Session reference_

.. _reduced redundancy: https://aws.amazon.com/s3/reduced-redundancy/ .. _Boto3 Session reference: https://boto3.amazonaws.com/v1/documentation/api/latest/reference/core/session.html#boto3.session.Session.resource

Similar software

The configuration in .s3_website.yaml was inspired by s3_website_ although the options supported by s3_website are slightly different.

.. _s3_website: https://github.com/laurilehmijoki/s3_website

Licence

MIT.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].