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.12.tar.gz
.
File metadata
- Download URL: gammarers_aws_secure_frontend_web_app_cloudfront_distribution-1.4.12.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 | 777ff1a87f49342b606a2e6e6776b0ff756fb4211d278c8da9d87d9f040eacf8 |
|
MD5 | b561c26a12696c7ac1d5fe9e6037df7a |
|
BLAKE2b-256 | 649715a8550fea534a79d6e23c9f0546376c294c7ac0a7f2aa63a5d6d75d73b5 |
File details
Details for the file gammarers.aws_secure_frontend_web_app_cloudfront_distribution-1.4.12-py3-none-any.whl
.
File metadata
- Download URL: gammarers.aws_secure_frontend_web_app_cloudfront_distribution-1.4.12-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 | bb73ef6642beb1ec0ce50e0bd81f847607ecfcc8705e12c69643c877f60a38ad |
|
MD5 | 12fdd4140eb0728d2c50f625e41edc94 |
|
BLAKE2b-256 | e2d448c3382ed6a59e6061b38c1dfac5e44b48745d27f8bccf817e5c82ecd5a5 |