@updraft/aws-static-site-https
v0.1.0
Published
Setup HTTPs only static site on AWS (✓ HTTPs only ✓ SPA & Subfolder support ✓ Route53 support ✓ Local Sources)
Downloads
1
Readme
@updraft/aws-static-site-https
Features
✓ HTTPs only - S3 bucket is private
✓ SPA & Subfolder support - Supports Single Page Apps & Hosting a static site (see RoutingMode
)
✓ Route53 support - Setup any Route53 (sub)domain to point to this site
✓ Local Sources - Directly deploy your website from your local codebase
Example
import * as cdk from '@aws-cdk/core'
import { RoutingMode, StaticSiteHttps } from '@updraft/aws-static-site-https'
class StaticHtml extends cdk.Stack {
constructor(scope: cdk.Construct, id: string, props) {
super(scope, id, props)
new StaticSiteHttps(this, 'static-site', {
domainName: 'example.com',
localPathSiteAssets: './website',
routingMode: RoutingMode.ENABLE_SUBFOLDERS,
})
}
}
const cdkApp = new cdk.App()
new StaticHtml(cdkApp, 'my-static-page', {
env: {
account: '1234567890',
region: 'eu-central-1'
}
})
Install
- If you want to use
RoutingMode.ENABLE_SUBFOLDERS
orRoutingMode.SPA
a lambda edge function is setup, which requires that you bootstrapus-east-1
for AWS CDK usage. (e.g. by runningnpx cdk bootstrap aws://<AWS-ACCOUNT-ID>/us-east-1
) yarn add @updraft/aws-static-site-https
License
MIT