Skip to main content

AWS CloudFront distribution origin S3 bucket.

Project description

AWS Secure CloudFront Origin Bucket (for CDK v2)

GitHub npm (scoped) PyPI Nuget GitHub Workflow Status (branch) GitHub release (latest SemVer)

View on Construct Hub

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

npm install @gammarers/aws-secure-cloudfront-origin-bucket

install by yarn

yarn add @gammarers/aws-secure-cloudfront-origin-bucket

install by pnpm

pnpm add @gammarers/aws-secure-cloudfront-origin-bucket

install by bun

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 OAC(Origin Access Control)

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.

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

File details

Details for the file gammarers_aws_secure_cloudfront_origin_bucket-2.1.2.tar.gz.

File metadata

File hashes

Hashes for gammarers_aws_secure_cloudfront_origin_bucket-2.1.2.tar.gz
Algorithm Hash digest
SHA256 76fddc241134ebb98acced856bf8c970b78046c7ea9fa052ceb1325d38d10e14
MD5 4739d128ac520c39e24bb02b0294de88
BLAKE2b-256 a59c419a67118bbf8ecf79db6132c3c5a0d30b6399a7e6ca1acfa24cd04e3ddf

See more details on using hashes here.

File details

Details for the file gammarers.aws_secure_cloudfront_origin_bucket-2.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for gammarers.aws_secure_cloudfront_origin_bucket-2.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 15e7b84df1d6ff4809f54db4c8886dfe4f83dd6b53771d233cbc70e1a56f79f4
MD5 cfc8cc789d9e5a957fa48ad20d313a07
BLAKE2b-256 bec8aa159b38693fc8c5ef3f4a23e97af9a3416b249b27abe9ca870ecaafe9c2

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page