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.14.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | ab492a165ef061d8fc4fc3200f40e6d27ac7344cc35bdc7658fc2a070e662424 |
|
MD5 | 9f5e028838d25c7af1c2a564a29559b3 |
|
BLAKE2b-256 | 68f35949843341f4ab3b25663d5c1f039de947daaac5c369a2fd3dd268dce753 |
Close
Hashes for onema_cdk.static_website-0.0.14-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8b78cc63bb9f3446ad61eb74e9774e9f2f1d974c973f924f329bc6c0feaf72f7 |
|
MD5 | f86d9736580dd38709ffcb0fb9d2e9a9 |
|
BLAKE2b-256 | 04b4cb6be6560e7c9dd153f4a757adb071aed4f9eeaf2ac28a4eb272de0f67e4 |