aws-cdk-static-site
TypeScript icon, indicating that this package has built-in type declarations

1.9.1 • Public • Published

Aws-cdk static site construct

coverage report

An npm module exporting a configurable static site construct.

Installing

npm i aws-cdk-static-site

Basic Usage

import * as cdk from "@aws-cdk/core";
import StaticSite from "aws-cdk-static-site";
 
export default class StaticSiteStack extends cdk.Stack {
    constructor(scope: cdk.App, id: string, props: cdk.StackProps) {
        super(scope, id, props);
 
        new StaticSite(this, id, {
            domainName: "example.com",
            siteAssetsPath: "./exampleSiteDirectory"
        });
    }
}

Specifying a subdomain

You can specify a subdomain using the siteSubDomain property.

new StaticSite(this, id, {
    siteSubDomain: "www",
    domainName: "example.com",
    siteAssetsPath: "./exampleSiteDirectory"
});

Specifying constructs

You can specify which constructs will be used with the constructConfig property.

new StaticSite(this, id, {
    domainName: "example.com",
    siteAssetsPath: "./exampleSiteDirectory",
    constructConfig: {
        useRoute53: true,
        useCloudfront: true,
        useDeletableBucket: false
    }
});

The construct config specified above is the default.

Links

Package Sidebar

Install

npm i aws-cdk-static-site

Weekly Downloads

2

Version

1.9.1

License

GPL-3.0-only

Unpacked Size

140 kB

Total Files

10

Last publish

Collaborators

  • straight-outta-crompton