Neatly Prepared Mustache

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

    0.1.0 • Public • Published

    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

    Install

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

    DownloadsWeekly Downloads

    3

    Version

    0.1.0

    License

    MIT

    Unpacked Size

    9.03 kB

    Total Files

    8

    Last publish

    Collaborators

    • lufo