skillfed

aws-cdk.aws-cloudfront

The CDK Construct Library for AWS::CloudFront

aws-cdk-aws-cloudfront v1.204.0 156.8K downloads/30d#10,774 on PyPI12,868
Permissive license Apache-2.0 Active released

What it is and what it does

This package provides AWS CDK constructs for defining CloudFront distributions declaratively in Python. It wraps CloudFront's API to let you configure content delivery from S3 buckets, load balancers, or custom HTTP origins, set up domain names and SSL certificates, define multiple behaviors with different routing rules, and manage cache settings—all as infrastructure-as-code rather than through the AWS console.

The package depends on 14 other AWS CDK modules (IAM, S3, Lambda, KMS, EC2, and others) plus core CDK infrastructure libraries. It is actively maintained in the AWS CDK repository but is part of CDK v1, which reached end-of-support on 2023-06-01. AWS recommends migrating to CDK v2 for new projects.

Use it for:

  • Define a CloudFront distribution backed by an S3 bucket in a CDK stack, with automatic origin access identity setup for private buckets.
  • Configure multiple behaviors with different URL path patterns to route requests to different origins or apply different caching policies.
  • Set up a custom domain name and ACM certificate for a distribution to serve content over HTTPS with your own domain.
  • Programmatically manage HTTP methods, viewer protocol policies, and query string forwarding rules for cache behaviors.
  • Integrate CloudFront with ELBv2 load balancers as origins for dynamic content delivery through a CDK stack.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Defines AWS CloudFront distributions and behaviors as code using the AWS CDK, enabling programmatic configuration of content delivery networks with S3, load balancers, or HTTP origins.

Yes, if you are maintaining or extending an existing AWS CDK v1 codebase. No, if you are starting a new project—use AWS CDK v2 instead. The package is stable and well-maintained within the active CDK repository, but v1 itself is end-of-support and will not receive updates; migration to v2 is the recommended path forward.

Install

aws-cdk-aws-cloudfront on PyPI

pip

pip install aws-cdk-aws-cloudfront

uv

uv add aws-cdk-aws-cloudfront

poetry

poetry add aws-cdk-aws-cloudfront

Installing aws-cdk.aws-cloudfront

Before you install

Low install friction with a pure-Python wheel. However, this is AWS CDK v1, which reached end-of-support on 2023-06-01 and is no longer being updated; users should migrate to AWS CDK v2.

License in practice

Licensed under Apache-2.0 (permissive), allowing free use, modification, and distribution with minimal restrictions.

Quickstart

from aws_cdk import aws_cloudfront as cloudfront
from aws_cdk import aws_s3 as s3
from aws_cdk import aws_cloudfront_origins as origins

my_bucket = s3.Bucket(self, "myBucket")
cloudfront.Distribution(self, "myDist",
    default_behavior=cloudfront.BehaviorOptions(origin=origins.S3Origin(my_bucket))
)

Requires AWS CDK v1 runtime and constructs library; v1 is end-of-support as of 2023-06-01.

Verify before relying

  • Whether existing v1 code will continue to work in production or if migration to v2 is mandatory for new projects.
  • Availability and completeness of migration tooling or automated upgrade paths from v1 to v2.

Package facts

License Apache-2.0 (permissive)
Python support supports the current Python release (~=3.7)
Install friction low — pure-Python wheel
Runtime dependencies 14 — aws-cdk.aws-certificatemanager, aws-cdk.aws-cloudwatch, aws-cdk.aws-ec2, aws-cdk.aws-iam, aws-cdk.aws-kms, aws-cdk.aws-lambda, aws-cdk.aws-s3, aws-cdk.aws-ssm, aws-cdk.core, aws-cdk.cx-api, constructs, jsii, publication, typeguard
Maintenance actively maintained — 1,152 days since the last release
Last repo commit
First released
Downloads 156,811/month — #10,774 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: aws_cdk.aws_cloudfront-1.204.0-py3-none-any.whl

Development Status :: 7 - InactiveFramework :: AWS CDKFramework :: AWS CDK :: 1Intended Audience :: DevelopersLicense :: OSI ApprovedOperating System :: OS IndependentProgramming Language :: JavaScriptProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Typing :: Typed

Tags

cloudfront cdn infrastructure as codeaws cdk cloudfront distributioncontent delivery network constructcloudfront origin behavior configurationcdk s3 cloudfront integrationaws edge location routingcloudfront domain certificate setup
infrastructure-as-codeaws-cdkend-of-support

More Build Tools packages

packaging

Provides reusable utilities for Python…

permissive · top 100 on PyPI

tqdm

Wraps any iterable to display a real-time…

copyleft · top 100 on PyPI

pip

pip is the standard installer for Python…

permissive · top 100 on PyPI

hatchling

Hatchling is a standards-compliant Python build…

permissive · top 100 on PyPI

grpcio-tools

Generates Python gRPC service stubs and message…

permissive · top 1,000 on PyPI

pre-commit

pre-commit is a framework for installing and…

permissive · top 1,000 on PyPI

aws-cdk.aws-s3

Defines AWS S3 buckets and related resources as…

permissive · top 15,000 on PyPI

s3cmd

s3cmd is a command-line tool for uploading,…

copyleft · top 5,000 on PyPI

aws-cdk.aws-codebuild

Defines AWS CodeBuild projects and build…

permissive · top 15,000 on PyPI

aws-cdk.aws-route53-targets

Provides Route53 alias record targets for AWS…

permissive · top 15,000 on PyPI

aws-cdk.aws-s3-deployment

Deploys files and directories to AWS S3 buckets…

permissive · top 15,000 on PyPI

aws-cdk.core

Provides the core construct classes and stack…

permissive · top 15,000 on PyPI

aws-cdk.aws-kinesisanalytics-flink-alpha

Provides AWS CDK constructs for defining and…

permissive · top 15,000 on PyPI

aws-cdk.region-info

Provides a queryable database of AWS…

permissive · top 15,000 on PyPI

aws-cdk.aws-certificatemanager

Provides AWS CDK Constructs for provisioning…

permissive · top 15,000 on PyPI

aws-cdk.aws-elasticloadbalancingv2

Provides AWS CDK constructs for defining and…

permissive · top 15,000 on PyPI