An AWS CDK construct library to create secure S3 buckets for CloudFront origin.
Warning
v2.1.0: remove origin access identity(oai) support
npm install @gammarers/aws-secure-cloudfront-origin-bucketyarn add @gammarers/aws-secure-cloudfront-origin-bucketpnpm add @gammarers/aws-secure-cloudfront-origin-bucketbun add @gammarers/aws-secure-cloudfront-origin-bucketpip install gammarers.aws-secure-cloudfront-origin-bucketdotnet add package gammarers.CDK.AWS.SecureCloudFrontOriginBucketimport { 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),
},
});This project is licensed under the Apache-2.0 License.