@maxou-cdk/static-website
v0.9.0
Published
Construct to create a static website hosted on S3 and served through CloudFront
Downloads
633
Readme
@maxou-cdk/static-website
A CDK construct to create a static website hosted on S3 and served through CloudFront.
Features
- Creates an S3 bucket to host your static website content
- Sets up a CloudFront distribution to serve your content
- Supports custom domain names with ACM certificates
- Configurable S3 deployments for your website files
- Enforces HTTPS-only access
- Implements secure S3 bucket policies with CloudFront origin access control
Installation
npm install @maxou-cdk/static-website
Usage
The construct can be used with minimal configuration to create a basic static website, or with additional options for custom domains and existing certificates.
const website = new StaticWebsite(this, "StaticWebsite", {
domainNames: ["docs.example.com"],
htdocsPath: "htdocs/",
});
⚠️ This construct should only be used in us-east-1, where ACM certificates can be attached to CloudFront distributions.