https://github.com/awslabs/staticwebsite-cli

Quickly and easily host a static website on AWS.

https://github.com/awslabs/staticwebsite-cli

Science Score: 13.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.2%) to scientific vocabulary

Keywords

aws cli cloudfront rust-lang static-website
Last synced: 5 months ago · JSON representation

Repository

Quickly and easily host a static website on AWS.

Basic Info
  • Host: GitHub
  • Owner: awslabs
  • License: apache-2.0
  • Language: Rust
  • Default Branch: main
  • Homepage:
  • Size: 101 KB
Statistics
  • Stars: 87
  • Watchers: 2
  • Forks: 4
  • Open Issues: 2
  • Releases: 7
Topics
aws cli cloudfront rust-lang static-website
Created almost 3 years ago · Last pushed almost 2 years ago
Metadata Files
Readme Contributing License Code of conduct

README.md

Static Website CLI

build

This CLI tool makes it easy to deploy a static website to AWS. It builds and hosts the website, sets up a CDN and DNS, and provisions an SSL certificate.

Prerequisites

In order to manage DNS, the tool needs to be able to configure endpoints in your DNS zone. You must have an existing Route53 zone corresponding to the --domain-zone specified. To purchase a new domain name and setup the corresponding zone, follow the Register a domain name instructions here.

This will have cost implications!

AWS Access

The tool needs AWS CLI credentials setup in order to deploy to AWS. The minimum policy required is available in a sample policy.json document.

Although the AWS CLI itself isn't required, staticwebsite-cli uses the same configuration system. The CLI's credential file configuration documentation will help you get started.

You will need to either:

  • Setup a profile in your AWS credentials file
  • Setup environment variables AWS_ACCESS_KEY and AWS_SECRET_ACCESS_KEY

Download the CLI

Grab the latest release artifact for your system. Builds are published for Windows, Mac, and Linux. Alternatively, clone this repository and run cargo build 🙂!

Usage

Simply specify: --domain-zone The zone to deploy the website into - e.g. - mydomain.com --domain-name The name of the host. If this isn't specified, we'll deploy at the apex --deploy The directory containing the static website to deploy Your website will then be accessible at https://{domain-name}.{domain-zone} or simply https://{domain-zone} if you didn't specify a domain-name within the zone

```bash

staticwebsite_cli --domain-zone demo.com --domain-name rustacean --deploy sample

💻 ➜ staticwebsite-cli git:(main) ✗ target/debug/staticwebsitecli --domain-zone demo.com --domain-name rustacean --deploy test INFO staticwebsitecli: Checking AWS access INFO staticwebsitecli: AWS access looks good, continuing INFO staticwebsitecli: Found zone zone="ABCDEFG" INFO staticwebsitecli: Using Cloudformation stack name="StaticSite--rustacean-demo-com" INFO staticwebsitecli: Stack doesnt exist; creating INFO staticwebsitecli: Stack created stackid="..." INFO staticwebsitecli: Waiting for stack deployment to complete ... INFO staticwebsitecli::cloudformationhelpers: Stack status status="CREATEINPROGRESS" INFO staticwebsitecli::cloudformationhelpers: Stack status status="CREATECOMPLETE" INFO staticwebsitecli: Stack deploy complete INFO staticwebsitecli: Finding website bucket INFO staticwebsitecli: Uploading bucket="..." INFO staticwebsitecli: Invalidating distribution distributionid="E3EF9EZ9CV2KGJ" INFO staticwebsitecli::cloudfronthelpers: Waiting for invalidation to complete INFO staticwebsitecli::cloudfronthelpers: Invalidation status="InProgress" INFO staticwebsitecli::cloudfronthelpers: Invalidation status="Completed" INFO staticwebsitecli: Distribution invalidated. Ready to go! INFO staticwebsitecli: Link href="https://rustacean.demo.com" INFO staticwebsitecli: All done! ```

Updates

Simply re-run staticwebsite_cli with the same arguments to replace the contents of the website. The CLI will invalidate the CDN distribution and the changes should become immediately available.

Removing the stack

  1. Login to the AWS console
  2. Visit the Cloudformation console in us-east-1
  3. Find the stack named StaticSite--your-domain-name and delete it.

Owner

  • Name: Amazon Web Services - Labs
  • Login: awslabs
  • Kind: organization
  • Location: Seattle, WA

AWS Labs

GitHub Events

Total
  • Watch event: 2
Last Year
  • Watch event: 2

Issues and Pull Requests

Last synced: almost 2 years ago

All Time
  • Total issues: 0
  • Total pull requests: 17
  • Average time to close issues: N/A
  • Average time to close pull requests: 7 days
  • Total issue authors: 0
  • Total pull request authors: 2
  • Average comments per issue: 0
  • Average comments per pull request: 0.12
  • Merged pull requests: 13
  • Bot issues: 0
  • Bot pull requests: 6
Past Year
  • Issues: 0
  • Pull requests: 8
  • Average time to close issues: N/A
  • Average time to close pull requests: 13 days
  • Issue authors: 0
  • Pull request authors: 2
  • Average comments per issue: 0
  • Average comments per pull request: 0.13
  • Merged pull requests: 5
  • Bot issues: 0
  • Bot pull requests: 3
Top Authors
Issue Authors
Pull Request Authors
  • scottgerring (11)
  • dependabot[bot] (7)
Top Labels
Issue Labels
Pull Request Labels
dependencies (7)

Dependencies

.github/workflows/build.yaml actions
  • actions-rs/cargo v1 composite
  • actions-rs/toolchain v1 composite
  • actions/checkout v2 composite
.github/workflows/release.yaml actions
  • actions/checkout master composite
  • rust-build/rust-build.action v1.4.0 composite
Cargo.lock cargo
  • 204 dependencies
Cargo.toml cargo