@rnbw/aws-cdk-static-website
v0.1.0
Published
CDK constructs for building static websites
Downloads
2
Maintainers
Readme
aws-cdk-static-website
AWS CDK constructs for building static websites.
Library
StaticWebsite
const { StaticWebsite } = require("@rnbw/aws-cdk-static-website");
class MyStack extends cdk.Stack {
// ...
const website = new StaticWebsite(this, "MyWebsite", {
zoneDomain: "example.com",
domain: "www.example.com",
sources: [
{
customOriginSource: {
domainName: "some.custom-origin.com"
},
behaviors: [{ isDefaultBehavior: true }]
}
]
});
// ...
new cdk.CfnOutput(this, "SiteUrl", {
value: `https://${website.dnsDomainRecord.domainName}`
});
new cdk.CfnOutput(this, "DistributionId", {
value: website.distribution.distributionId
});
}
Check the full example.
Development
Useful commands
yarn build
yarn test
Roadmap
- StaticWebsite: domain aliases
- StaticWebsite: domain redirection