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.

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 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

File details

Details for the file gammarers.aws-secure-cloudfront-origin-bucket-1.6.8.tar.gz.

File metadata

File hashes

Hashes for gammarers.aws-secure-cloudfront-origin-bucket-1.6.8.tar.gz
Algorithm Hash digest
SHA256 b629de574de7acd63df7288154d9a2e62b4c8545ec3e41ed7865372454d22aea
MD5 6a37d387cadef1d9f54fda2c1ec0ef31
BLAKE2b-256 7cb143d07172929761a1269e0d1f20d8c72fa3cfdc7d1bdb06b3f50e1e843660

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gammarers.aws_secure_cloudfront_origin_bucket-1.6.8-py3-none-any.whl
Algorithm Hash digest
SHA256 54f09acc9c765513a25cd84eadef0874acc274a09774620c8b854bc5146de25d
MD5 5b372e3ee12f8ee94edacaee40d6387f
BLAKE2b-256 acec6dd8c374fdc78d805797d9dfa9ee49338d4ba502d06333237465d6801a91

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