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

File metadata

File hashes

Hashes for gammarers.aws-secure-cloudfront-origin-bucket-1.6.9.tar.gz
Algorithm Hash digest
SHA256 d10b6bd4b7836665844823b151facffad20f2f986f6c58df2be8354ca4c567ad
MD5 af609b53178eb5dc10d1660c27984f5d
BLAKE2b-256 e9937c60a9487b3783ea88d3ac300f7a1a54fd8cea5cca80b7ed1207676737ca

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gammarers.aws_secure_cloudfront_origin_bucket-1.6.9-py3-none-any.whl
Algorithm Hash digest
SHA256 4eba8b66558e86847ce7422c38749c6c57bcb1ad5cf6cbf96350cb8c0b3c5216
MD5 458b6406e025851f1b4dc6b1c3024e1c
BLAKE2b-256 3d91948e4a62364523d8e69b5618edd135bbfc95b1d564626f4c8eb42557b0ed

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