@rnbw/aws-cdk-s3-website
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

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

Package Sidebar

Install

npm i @rnbw/aws-cdk-s3-website

Weekly Downloads

0

Version

0.1.0

License

MIT

Unpacked Size

6.75 kB

Total Files

6

Last publish

Collaborators

  • lufo