This package has been deprecated

Author message:

WARNING: This project has been renamed to @gammarers/aws-secure-frontend-web-app-cloudfront-distribution. Install using @gammarers/aws-secure-frontend-web-app-cloudfront-distribution instead.

@gammarer/aws-secure-frontend-web-app-cloudfront-distribution
TypeScript icon, indicating that this package has built-in type declarations

1.2.2 • Public • Published

AWS Secure Frontend Web App CloudFront Distribution (for AWS CDK v2)

GitHub npm (scoped) PyPI Nuget Sonatype Nexus (Releases) GitHub Workflow Status (branch) GitHub release (latest SemVer)

View on Construct Hub

AWS CloudFront distribution for frontend web app (spa) optimized.

Install

TypeScript

npm install @gammarer/aws-secure-frontend-web-app-cloudfront-distribution
# or
yarn add @gammarer/aws-secure-frontend-web-app-cloudfront-distribution

Python

pip install gammarer.aws-secure-frontend-web-app-cloudfront-distribution

C# / .NET

dotnet add package Gammarer.CDK.AWS.SecureFrontendWebAppCloudFrontDistribution

Java

Add the following to pom.xml:

<dependency>
  <groupId>com.gammarer</groupId>
  <artifactId>aws-secure-frontend-web-app-cloudfront-distribution</artifactId>
</dependency>

Example

for Origin Access Control

import { SecureFrontendWebAppCloudFrontDistribution, S3OriginAccessType } from '@gammarer/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 '@gammarer/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.

Package Sidebar

Install

npm i @gammarer/aws-secure-frontend-web-app-cloudfront-distribution

Weekly Downloads

144

Version

1.2.2

License

Apache-2.0

Unpacked Size

200 kB

Total Files

8

Last publish

Collaborators

  • yicr