cdk-static-website-0.1.0
توضیحات
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
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | cdk-static-website-0.1.0 |
| نام | cdk-static-website |
| نسخه کتابخانه | 0.1.0 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Juan Manuel Torres |
| ایمیل نویسنده | software@onema.io |
| آدرس صفحه اصلی | https://github.com/onema/cdk-constructs |
| آدرس اینترنتی | https://pypi.org/project/cdk-static-website/ |
| مجوز | - |
# 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
```python
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")
```
نیازمندی
| مقدار | نام |
|---|---|
| - | aws-cdk.core |
| - | aws-cdk.aws-events |
| - | aws-cdk.aws-events-targets |
| - | aws-cdk.aws-certificatemanager |
| - | aws-cdk.aws-cloudfront |
| - | aws-cdk.aws-route53 |
| - | aws-cdk.aws-route53-targets |
| - | aws-cdk.aws-s3 |
| - | aws-cdk.aws-s3-deployment |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.6 | Python |
نحوه نصب
نصب پکیج whl cdk-static-website-0.1.0:
pip install cdk-static-website-0.1.0.whl
نصب پکیج tar.gz cdk-static-website-0.1.0:
pip install cdk-static-website-0.1.0.tar.gz