@gammarers/aws-secure-frontend-web-app-cloudfront-distribution
Version:
AWS CloudFront distribution for frontend web app (spa) optimized.
65 lines (44 loc) • 2.95 kB
Markdown
# AWS Secure Frontend Web App CloudFront Distribution (for AWS CDK v2)
[](https://github.com/gammarers/aws-secure-frontend-web-app-cloudfront-distribution/blob/main/LICENSE)
[](https://www.npmjs.com/package/@gammarers/aws-secure-frontend-web-app-cloudfront-distribution)
[](https://pypi.org/project/gammarers.aws-secure-frontend-web-app-cloudfront-distribution/)
[](https://www.nuget.org/packages/Gammarers.CDK.AWS.SecureFrontendWebAppCloudFrontDistribution/)
[](https://github.com/gammarers/aws-secure-frontend-web-app-cloudfront-distribution/actions/workflows/release.yml)
[](https://github.com/gammarers/aws-secure-frontend-web-app-cloudfront-distribution/releases)
[](https://constructs.dev/packages/@gammarers/aws-secure-frontend-web-app-cloudfront-distribution)
AWS CloudFront distribution for frontend web app (spa) optimized.
## Install
### TypeScript
#### npm
```shell
npm install @gammarers/aws-secure-frontend-web-app-cloudfront-distribution
```
#### yarn
```shell
yarn add @gammarers/aws-secure-frontend-web-app-cloudfront-distribution
```
### Python
```shell
pip install gammarers.aws-secure-frontend-web-app-cloudfront-distribution
```
### C# / .NET
```shell
dotnet add package Gammarers.CDK.AWS.SecureFrontendWebAppCloudFrontDistribution
```
## Example
### for Origin Access Control
```typescript
import { SecureFrontendWebAppCloudFrontDistribution } from '@gammarers/aws-secure-frontend-web-app-cloudfront-distribution';
declare const originBucket: s3.Bucket;
declare const accessLogBucket: s3.Bucket;
declare const certificate: acm.Certificate;
new SecureFrontendWebAppCloudFrontDistribution(stack, 'SecureFrontendWebAppCloudFrontDistribution', {
comment: 'frontend web app distribution.', // optional
accessLogBucket: accessLogBucket, // optional
certificate: certificate,
distributionDomainName: 'example.com',
originBucket: originBucket,
});
```
## License
This project is licensed under the Apache-2.0 License.