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-2.0.0.tar.gz.

File metadata

File hashes

Hashes for gammarers_aws_secure_cloudfront_origin_bucket-2.0.0.tar.gz
Algorithm Hash digest
SHA256 fe82ab571c0ec814ca4b4458bbdef5b5bd440182a6ba7aa5238ac906c09c04eb
MD5 d5d2142a7b2434ed61f5a1b0a614db0c
BLAKE2b-256 f5a062637f7212eb3a5ddb30ca4c8b55a87552755cd2964f7618b0d5fe169c3b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gammarers.aws_secure_cloudfront_origin_bucket-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4376c691946694f493878ba0b6e2dedaea57f1951c3482df2f05278292b764f8
MD5 7dd55fbd4672cf739237e086dff96946
BLAKE2b-256 02d770e4ba2f18d882fb49004e639a03ae715906be524d2a355bc08e50822b1d

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