AWS CloudFront distribution for frontend web app (spa) optimized.
Project description
AWS Secure Frontend Web App CloudFront Distribution (for AWS CDK v2)
AWS CloudFront distribution for frontend web app (spa) optimized.
Install
TypeScript
npm install @gammarers/aws-secure-frontend-web-app-cloudfront-distribution
# or
yarn add @gammarers/aws-secure-frontend-web-app-cloudfront-distribution
Python
pip install gammarers.aws-secure-frontend-web-app-cloudfront-distribution
C# / .NET
dotnet add package Gammarers.CDK.AWS.SecureFrontendWebAppCloudFrontDistribution
Example
for Origin Access Control
import { SecureFrontendWebAppCloudFrontDistribution, S3OriginAccessType } from '@gammarers/aws-secure-frontend-web-app-cloudfront-distribution';
declare const originBucket: s3.Bucket;
declare const accessLogBucket: s3.Bucket;
declare const certificate: acm.Certificate;
declare const cfnOriginAccessControl: cloudfront.CfnOriginAccessControl
new SecureFrontendWebAppCloudFrontDistribution(stack, 'SecureFrontendWebAppCloudFrontDistribution', {
comment: 'frontend web app distribution.', // optional
accessLogBucket: accessLogBucket, // optional
certificate: certificate,
distributionDomainName: 'example.com',
s3OriginAccessType: S3OriginAccessType.ORIGIN_ACCESS_CONTROL,
originAccessControlId: cfnOriginAccessControl.attrId,
originBucket: originBucket,
});
for Origin Access Identity
import { SecureFrontendWebAppCloudFrontDistribution, S3OriginAccessType } from '@gammarers/aws-secure-frontend-web-app-cloudfront-distribution';
declare const originBucket: s3.Bucket;
declare const accessLogBucket: s3.Bucket;
declare const certificate: acm.Certificate;
declare const originAccessIdentity: cloudfront.OriginAccessIdentity;
new SecureFrontendWebAppCloudFrontDistribution(stack, 'SecureFrontendWebAppCloudFrontDistribution', {
comment: 'frontend web app distribution.', // optional
accessLogBucket: accessLogBucket, // optional
certificate: certificate,
distributionDomainName: 'example.com',
s3OriginAccessType: S3OriginAccessType.ORIGIN_ACCESS_IDENTITY,
originAccessIdentity: originAccessIdentity,
originBucket: originBucket,
});
License
This project is licensed under the Apache-2.0 License.
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
File details
Details for the file gammarers_aws_secure_frontend_web_app_cloudfront_distribution-1.4.13.tar.gz
.
File metadata
- Download URL: gammarers_aws_secure_frontend_web_app_cloudfront_distribution-1.4.13.tar.gz
- Upload date:
- Size: 36.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f42852f9a6a7f45d73d5918bfe92d825cfd4038a72915a2e641c0e368523a8e9 |
|
MD5 | 9d17a82c23b51d8a82709b1845fe4ad6 |
|
BLAKE2b-256 | 2129b15c30455ef931ed03d5cf7bc6e400c94142d7cc6dc136f2a0e9d8a27695 |
File details
Details for the file gammarers.aws_secure_frontend_web_app_cloudfront_distribution-1.4.13-py3-none-any.whl
.
File metadata
- Download URL: gammarers.aws_secure_frontend_web_app_cloudfront_distribution-1.4.13-py3-none-any.whl
- Upload date:
- Size: 35.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b71a1801701b23b0201d6ab6ea11bd1a650b8a704bfa18bd3d63bc93c26ca6c0 |
|
MD5 | 4df5ba533f775f6520aa1f1ca9cf8ce2 |
|
BLAKE2b-256 | f7404c313495758f06c0a6557f010f270faa6fd552a732756462209b361ced26 |