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 static_website import StaticWebsite
from 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.9.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3af11f42e9379ff8a8f932498d3db88c3799c647868d99d37453b24a457a1f4e |
|
MD5 | 8085853f8e2a2baafd0a2a5ff8e9c9d3 |
|
BLAKE2b-256 | 2bef8286cdd34d6a9bf50bc007816b59ef81a5f7c28ff46c874953f07a54736c |
Close
Hashes for onema_cdk.static_website-0.0.9-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 00ad4c9c5b7259f0502629694fc9e62633a7d95f53b635a0b72a5b63f9558a75 |
|
MD5 | 778fae32f0c290aec31f1081ff39a6b8 |
|
BLAKE2b-256 | acaf82240334cbe17d5964a9ab9bfdc53aec0adcef52c66e8b470080deaf4f9a |