AWS Fundamentals Logo
AWS Fundamentals

Amazon CloudFront

34 CDK constructs available in aws-cdk-lib/aws-cloudfront

import * as cloudfront from 'aws-cdk-lib/aws-cloudfront';

L2 Constructs14

Higher-level abstractions with sensible defaults and convenience methods.

CachePolicy

L2

A Cache Policy configuration.

CloudFrontWebDistribution

L2

Amazon CloudFront is a global content delivery network (CDN) service that securely delivers data, videos, applications, and APIs to your viewers with low latency and high transfer speeds. CloudFront fronts user provided content and caches it at edge locations across the world. Here's how you can use this construct: ```ts const sourceBucket = new s3.Bucket(this, 'Bucket'); const distribution = new cloudfront.CloudFrontWebDistribution(this, 'MyDistribution', { originConfigs: [ { s3OriginSource: { s3BucketSource: sourceBucket, }, behaviors : [ {isDefaultBehavior: true}], }, ], }); ``` This will create a CloudFront distribution that uses your S3Bucket as its origin. You can customize the distribution using additional properties from the CloudFrontWebDistributionProps interface.

Distribution

L2

A CloudFront distribution with associated origin(s) and caching behavior(s).

Function

L2

A CloudFront Function.

FunctionUrlOriginAccessControl

L2

An Origin Access Control for Lambda Function URLs.

KeyGroup

L2

A Key Group configuration.

KeyValueStore

L2

A CloudFront Key Value Store.

OriginAccessIdentity

L2

An origin access identity is a special CloudFront user that you can associate with Amazon S3 origins, so that you can secure all or just some of your Amazon S3 content.

OriginRequestPolicy

L2

A Origin Request Policy configuration.

PublicKey

L2

A Public Key Configuration.

RealtimeLogConfig

L2

A Realtime Log Config configuration.

ResponseHeadersPolicy

L2

A Response Headers Policy configuration.

S3OriginAccessControl

L2

An Origin Access Control for Amazon S3 origins.

VpcOrigin

L2

A CloudFront VPC Origin configuration.

L1 Constructs20

Direct CloudFormation resource mappings. One-to-one with CloudFormation resource types.

Get the Amazon CloudFront Cheat Sheet

Everything you need to know about Amazon CloudFront on one page. HD quality, print-friendly.

Download Free Infographic

Quick Facts

L2 Constructs14
L1 Constructs20
Moduleaws-cdk-lib/aws-cloudfront