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.17.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 59ba666c9380f517d3f41a3d6e096a09d8d19141af5dd79f10c7a5ee2dff2c3b |
|
MD5 | 363280b7713df6d79bfa3ab780442cf5 |
|
BLAKE2b-256 | 5ca92608391999e0955d35957ce2c999e9d506da9bdf0c914c78784b4156b38c |
Close
Hashes for onema_cdk.static_website-0.0.17-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 458aeaa7c69d92ed1c9b99b1203f3aaee7dae526e80b9ac1e4ee39215a3f7646 |
|
MD5 | de40f3c3d28a557f11bb35020da99297 |
|
BLAKE2b-256 | 1f3430162006db340ef1854db0034a57bbc9b0bc0acd85d39299d54577bf8a9a |