An AWS CDK construct to instantly deploy a static website on serverless infrastructure. Easy, fast, done.
Use the package manager npm to install cdk-website.
npm install cdk-website
import { Construct, Stack, StackProps } from '@aws-cdk/core'
import { WebsiteProps, Website } from 'cdk-website'
export class CdkStack extends Stack {
constructor(scope: Construct, id: string, props: StackProps) {
super(scope, id, props)
const websiteProps: WebsiteProps = {
domain: 'aws.com',
subdomain: 'awesome-cdk',
websiteFolder: '../website/dist',
indexDoc: 'index.html',
errorDoc: 'index.html',
}
new Website(this, `Website`, websiteProps).deploy()
}
}
- Add more tests
- Add support for only domain
- Add more configurable options if needed
Contributions of all kinds are welcome and celebrated. Raise an issue, submit a PR, do the right thing.
To set up a dev environment:
- Clone repo
yarn install
Development workflow (change code and run tests automatically):
yarn test:watch
Build (like CI):
yarn build
Release new versions:
yarn bump
And then publish as a PR.