@rnbw/aws-cdk-s3-website
v0.1.0
Published
CDK constructs for building S3-hosted websites
Downloads
1
Maintainers
Readme
aws-cdk-s3-website
AWS CDK constructs for building S3-hosted websites.
Library
S3Website
const { S3Website } = require("@rnbw/aws-cdk-s3-website");
class MyStack extends cdk.Stack {
// ...
const website = new S3Website(this, "MyWebsite", {
zoneDomain: "example.com",
domain: "www.example.com",
sourcePath: "./public"
});
// ...
new cdk.CfnOutput(this, "SiteUrl", {
value: `https://${website.dnsDomainRecord.domainName}`
});
new cdk.CfnOutput(this, "BucketArn", {
value: website.bucket.bucketArn
});
new cdk.CfnOutput(this, "DistributionId", {
value: website.distribution.distributionId
});
}
Check the full example.
Development
Useful commands
yarn build
yarn test
Roadmap
- S3Website: domain aliases
- S3Website: domain redirection