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.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9c06b5206010959cae5c94f5f1b1e43ebc8e058819de404159ccd4235c557999 |
|
MD5 | c0c83692e8ed7ef12a1adccac3008bcb |
|
BLAKE2b-256 | 4b0e3b8752b83fc9b51e316c4b9e139a7e1b6f132f0a08d7eea1aa72e5f69cf2 |
Close
Hashes for gammarers.aws_secure_cloudfront_origin_bucket-1.5.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d9b319f1bab2f855d47134fb47705570254c4441b7e98c6512546e0fe30f5e1d |
|
MD5 | 0b5a9e1f85faa64a0bdd2692315e13d2 |
|
BLAKE2b-256 | e3f98820eb9d70f24bf76172cf969f34dd7bad23f153dd1056ca040e1713da88 |