AWS CloudFront distribution for frontend web app (spa) optimized.
npm install @gammarers/aws-secure-frontend-web-app-cloudfront-distribution
# or
yarn add @gammarers/aws-secure-frontend-web-app-cloudfront-distribution
pip install gammarers.aws-secure-frontend-web-app-cloudfront-distribution
dotnet add package Gammarers.CDK.AWS.SecureFrontendWebAppCloudFrontDistribution
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,
});
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,
});
This project is licensed under the Apache-2.0 License.