https://github.com/gammarers/aws-secure-cloudfront-origin-bucket
secure cloudfront origin bucket
https://github.com/gammarers/aws-secure-cloudfront-origin-bucket
aws aws-cdk bucket cdk s3 secure
Last synced: 6 months ago
JSON representation
secure cloudfront origin bucket
- Host: GitHub
- URL: https://github.com/gammarers/aws-secure-cloudfront-origin-bucket
- Owner: gammarers
- License: apache-2.0
- Created: 2023-01-10T09:41:19.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-12-29T17:33:56.000Z (7 months ago)
- Last Synced: 2024-12-30T02:50:27.965Z (7 months ago)
- Topics: aws, aws-cdk, bucket, cdk, s3, secure
- Language: TypeScript
- Homepage:
- Size: 1.76 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# AWS Secure CloudFront Origin Bucket (for CDK v2)
[](https://github.com/gammarers/aws-secure-cloudfront-origin-bucket/blob/main/LICENSE)
[](https://www.npmjs.com/package/@gammarers/aws-secure-cloudfront-origin-bucket)
[](https://pypi.org/project/gammarers.aws-secure-cloudfront-origin-bucket/)
[](https://www.nuget.org/packages/Gammarers.CDK.AWS.ScureCloudFrontOriginBucket/)
[](https://github.com/gammarers/aws-secure-cloudfront-origin-bucket/actions/workflows/release.yml)
[](https://github.com/gammarers/aws-secure-cloudfront-origin-bucket/releases)[](https://constructs.dev/packages/@gammarers/aws-secure-cloudfront-origin-bucket)
An AWS CDK construct library to create secure S3 buckets for CloudFront origin.
> [!WARNING]
> v2.1.0: remove origin access identity(oai) support## Install
### TypeScript
#### install by npm
```shell
npm install @gammarers/aws-secure-cloudfront-origin-bucket
```
#### install by yarn```shell
yarn add @gammarers/aws-secure-cloudfront-origin-bucket
```
#### install by pnpm```shell
pnpm add @gammarers/aws-secure-cloudfront-origin-bucket
```
#### install by bun```shell
bun add @gammarers/aws-secure-cloudfront-origin-bucket
```### Python
```shell
pip install gammarers.aws-secure-cloudfront-origin-bucket
```### C# / .NET
```shell
dotnet add package gammarers.CDK.AWS.SecureCloudFrontOriginBucket
```## Example
### for OAC(Origin Access Control)
```typescript
import { SecureCloudFrontOriginBucket, SecureCloudFrontOriginType } from '@gammarers/aws-secure-cloudfront-origin-bucket';const originBucket = new SecureCloudFrontOriginBucket(stack, 'SecureCloudFrontOriginBucket', {
bucketName: 'example-origin-bucket',
});const distribution = new cloudfront.Distribution(this, 'Distribution', {
defaultRootObject: 'index.html',
defaultBehavior: {
origin: origins.S3BucketOrigin.withOriginAccessControl(originBucket),
},
});
```## License
This project is licensed under the Apache-2.0 License.