An AWS CDK construct library to create secure S3 buckets for CloudFront origin.
npm install @gammarers/aws-secure-cloudfront-origin-bucket
yarn add @gammarers/aws-secure-cloudfront-origin-bucket
pnpm add @gammarers/aws-secure-cloudfront-origin-bucket
bun add @gammarers/aws-secure-cloudfront-origin-bucket
pip install gammarers.aws-secure-cloudfront-origin-bucket
dotnet add package gammarers.CDK.AWS.SecureCloudFrontOriginBucket
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,
});
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}`,
});
This project is licensed under the Apache-2.0 License.