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.15.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e7633a412c56a94d3cec188ff9631398ea1fbfa70e7e81aa37ff634aa3c44f2d |
|
MD5 | 05a56edf7af75eb9b12bcf25f930b301 |
|
BLAKE2b-256 | 4164d73aa0c7a12f33e26e54221a9fe651603329149e8cf2a589f30072f429fc |
Close
Hashes for onema_cdk.static_website-0.0.15-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7bfd301be6513855eaedeacdf7b84e3e234105fb0a6d7e8beebbeb1255487cfb |
|
MD5 | 2b6437846b97264cca5b0d7cde53fc36 |
|
BLAKE2b-256 | 6178a1fb3cdb506ff7ba4fb93107abab24664d9910bf9ffff991dcaad04edc37 |