Package Exports
- aws-cdk-static-site
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (aws-cdk-static-site) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Aws-cdk static site construct
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
- Static site construct inspired by the static-site example.
- CI/CD setup using this post.