AWS CloudFront distribution origin S3 bucket.
Project description
AWS Secure CloudFront Origin Bucket (for CDK v2)
An AWS CDK construct library to create secure S3 buckets for CloudFront origin.
Install
TypeScript
npm install @gammarers/aws-secure-cloudfront-origin-bucket
# or
yarn add @gammarers/aws-secure-cloudfront-origin-bucket
# or
pnpm add @gammarers/aws-secure-cloudfront-origin-bucket
# or
bun add @gammarers/aws-secure-cloudfront-origin-bucket
Python
pip install gammarers.aws-secure-cloudfront-origin-bucket
C# / .NET
dotnet add package gammarers.CDK.AWS.SecureCloudFrontOriginBucket
Example
for OAI(Origin Access Identity)
import { SecureCloudFrontOriginBucket, SecureCloudFrontOriginType } from '@gammarers/aws-secure-cloudfront-origin-bucket';
const oai = new cloudfront.OriginAccessIdentity(stack, 'OriginAccessIdentity');
new SecureCloudFrontOriginBucket(stack, 'SecureCloudFrontOriginBucket', {
bucketName: 'example-origin-bucket',
cloudFrontOriginType: SecureCloudFrontOriginType.ORIGIN_ACCESS_IDENTITY,
cloudFrontOriginAccessIdentityS3CanonicalUserId: oai.cloudFrontOriginAccessIdentityS3CanonicalUserId,
});
for OAC(Origin Access Control)
import { SecureCloudFrontOriginBucket, SecureCloudFrontOriginType } from '@gammarers/aws-secure-cloudfront-origin-bucket';
declare const distribution: cloudfront.Distribution;
new SecureCloudFrontOriginBucket(stack, 'SecureCloudFrontOriginBucket', {
bucketName: 'example-origin-bucket',
cloudFrontOriginType: SecureCloudFrontOriginType.ORIGIN_ACCESS_CONTROL,
cloudFrontArn: `arn:aws:cloudfront::123456789:distribution/${distribution.distributionId}`,
});
License
This project is licensed under the Apache-2.0 License.
Project details
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
Close
Hashes for gammarers.aws-secure-cloudfront-origin-bucket-1.5.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 82815c2f90e36fb242304f1638a5186abd7309456c13b8db3a087c964c290f76 |
|
MD5 | 7c3da8de56fc3741500ff03dc4f43834 |
|
BLAKE2b-256 | 86e1841cf121055d284a234fd1270cad9a4e76eb12830a07c63e4138a4aad680 |
Close
Hashes for gammarers.aws_secure_cloudfront_origin_bucket-1.5.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2ca39d3a66b3730f665121ca95b83b8412f57c99315c5e8cebae9e2e0d2105f6 |
|
MD5 | 64880bf6c9f07d54ba65004ae6b5c299 |
|
BLAKE2b-256 | f0569192691e5979d9d27ce5cfc552ac0ae1aec21ea5ac7b82a0060a7d15cf81 |