A CDK Python construct to create static S3 websites. This is a port of the AWS static site example https://github.com/aws-samples/aws-cdk-examples/blob/master/typescript/static-site/static-site.ts
Project description
Simple static site CDK construct
This constructs creates a static website hosted on S3.
Requirements
- Hosted zone in Route53
Usage
This constructs creates:
- S3 bucket
- DNS Validated certificate
- CloudFront web distribution
- Route53 A record
from aws_cdk.core import Stack, Construct
from static_website import StaticWebsite
from aws_cdk.aws_route53 import HostedZone
class WebSiteStack(Stack):
def __init__(self, scope: Construct, id: str, **kwargs):
super().__init__(scope, id, **kwargs)
# The code that defines your stack goes here
zone = HostedZone.from_lookup(self, "HostedZone",
domain_name="mydomain.com",
private_zone=False)
StaticWebsite(self, "serverlesslink-website",
hosted_zone=zone,
site_domain="blog.mydomain.com",
sources="../public",
website_error="404.html")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for onema-cdk.static-website-0.0.12.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 12eb48f23d79657d7d3970f0e2fd1bfcf98cc3c363c4b0f75ded350c519c7edb |
|
MD5 | 8097d4e9e00be979ac738cdcd2a11c70 |
|
BLAKE2b-256 | 39481aa47da245ebcefbe46a75c6bcff434538c22707ae0cba6c1718f3b3b2d3 |
Close
Hashes for onema_cdk.static_website-0.0.12-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1f48544fb96e7b37fda7e5520ad927dd1272bc14208b0a80feeda7487a0dafa7 |
|
MD5 | 5024dcc41f7bdc9907a247579cd9b6f6 |
|
BLAKE2b-256 | dd17faf349fd2ebb715283c1d9eb3985a0bc7dbeb973ab15be6c824a34134a44 |