CDK-Hugo-Deploy
This is an AWS CDK Construct for easily deploying Hugo Static websites to AWS S3 behind SSL/Cloudfront.
Usage
Before deploying, run the hugo command in your Hugo project to generate a built site in the public directory.
Typescript
import { App, Stack, StackProps } from 'aws-cdk-lib';
import { HugoDeploy } from 'cdk-hugo-deploy';
export class MyStack extends Stack {
constructor(scope: Construct, id: string, props?: StackProps) {
super(scope, id, props);
new HugoDeploy(this, 'HugoDeploy', {
publicDir: 'path/to/hugo-project/public',
domainName: 'example.com' // Domain you already have a hosted zone for
});
}
Python
from constructs import Construct
from aws_cdk import Stack
from cdk_hugo_deploy import HugoDeploy
class MyStack(Stack):
def __init__(self, scope: Construct, id: str, **kwargs):
super().__init__(scope, id, **kwargs)
HugoDeploy(self, "HugoDeploy",
public_dir="path/to/hugo-project/public",
domain_name="example.com"
)
Prerequisites
Assumes that there is already a Route53 hosted zone for domainName that can be looked up
Why this construct?
Other constructs for deploying Single Page Applicationis (SPA) such as CDK-SPA-Deploy don't account for how Hugo handles paths that end in /.
This construct includes a Cloudfront Function to rewrite paths to ensure /path/to/page/ will request /path/to/page/index.html from the S3 Origin.
Contributing
Please open an issue with any updates/features you'd like on this
Metadata
Release files for cdk-hugo-deploy 0.0.443
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| cdk-hugo-deploy-0.0.443.tar.gz | 33.8 kB | Without provenance | Details for cdk-hugo-deploy-0.0.443.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cdk_hugo_deploy-0.0.443-py3-none-any.whl | Python 3 | none | any | Details for cdk_hugo_deploy-0.0.443-py3-none-any.whl |
Total release size: 66.2 kB
Release files / cdk-hugo-deploy-0.0.443.tar.gz
| Download URL | cdk-hugo-deploy-0.0.443.tar.gz |
|---|---|
| Size | 33.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9576f62969cb4457f7a106487a06a647f41851cb1b4f04c76f1f1a2a1e28cc69
|
|
BLAKE2b-256 checksum How to use checksums |
50fbee7c3ac85d34283884d53450eabaef1e3d90ced6414eccc9b7c395ab1207
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.2
|
Release files / cdk_hugo_deploy-0.0.443-py3-none-any.whl
| Download URL | cdk_hugo_deploy-0.0.443-py3-none-any.whl |
|---|---|
| Size | 32.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b98f2c82807882a735cdf01c0c010405ce2f51388ea6918181744a55dff604fe
|
|
BLAKE2b-256 checksum How to use checksums |
68134cc541ef87c1d8a9c07bbdb33784335798ade9b7993c62ba6d071a8552c8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.2
|
Security for cdk-hugo-deploy 0.0.443
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.