Haiku9
Haiku9 (H9 for short) is a static site publisher. H9 supports:
- Syncing Web assets with an S3 bucket
- Configuring that bucket as a website
- Optionally fronting that bucket with a CloudFront distribution to support edge caching and/or TLS termination.
H9 provides CLI and programmatic interfaces, though most of the configuration is handled with your h9.yaml
file.
Installation
Local
npm install -g haiku9
Configuration
AWS Profile
H9 uses your AWS access to perform actions on your behalf. Your environment needs access to AWS credentials that can be reached by the SharedIniFileCredentials
method
From that reference:
defaulting to ~/.aws/credentials
or defined by the AWS_SHARED_CREDENTIALS_FILE
environment variable
Within that file, you can assign credentials to multiple "profiles" for easy access. H9 can accept that profile name as a command-line argument
h9 publish production -p "panda"
H9 File
At the root of your site, create a h9.yaml
file. Here is an example for publishing to a hypothetical https://haiku9.pandastrike.com
source: build
domain: pandastrike.com
region: us-west-1
site:
index: index
error: 404
cors: wildstyle
environments:
staging:
hostnames:
- staging-haiku
production:
hostnames:
- haiku
cache:
expires: 1800
ssl: true
priceClass: 100
Publishing
To publish your compiled site to AWS, first confirm that your AWS credentials are defined in ~/.aws/credentials
:
[default]
aws_access_key_id=AKIAIOSFODNN7EXAMPLE
aws_secret_access_key=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Next, publish to AWS:
h9 publish <environment>
And in a few minutes you will have a new website.
If you would like to tear it down.
h9 delete <environment>
And it will be gone just as easily.