AWS Fundamentals Logo
AWS Fundamentals
L1 ConstructAWS::Lightsail::Distribution

CfnDistribution

The `AWS::Lightsail::Distribution` resource specifies a content delivery network (CDN) distribution. You can create distributions only in the `us-east-1` AWS Region. A distribution is a globally distributed network of caching servers that improve the performance of your website or web application hosted on a Lightsail instance, static content hosted on a Lightsail bucket, or through a Lightsail load balancer.

Import

import { CfnDistribution } from 'aws-cdk-lib/aws-lightsail';

Or use the module namespace:

import * as lightsail from 'aws-cdk-lib/aws-lightsail';
// lightsail.CfnDistribution

Properties

Configuration passed to the constructor as CfnDistributionProps.

bundleIdRequired
string

The ID of the bundle applied to the distribution.

defaultCacheBehaviorRequired
IResolvable | CacheBehaviorProperty

An object that describes the default cache behavior of the distribution.

distributionNameRequired
string

The name of the distribution.

originRequired
IResolvable | InputOriginProperty

An object that describes the origin resource of the distribution, such as a Lightsail instance, bucket, or load balancer. The distribution pulls, caches, and serves content from the origin.

cacheBehaviorsOptional
IResolvable | IResolvable | CacheBehaviorPerPathProperty[]

An array of objects that describe the per-path cache behavior of the distribution.

cacheBehaviorSettingsOptional
IResolvable | CacheSettingsProperty

An object that describes the cache behavior settings of the distribution.

certificateNameOptional
string

The name of the SSL/TLS certificate attached to the distribution.

ipAddressTypeOptional
string

The IP address type of the distribution. The possible values are `ipv4` for IPv4 only, and `dualstack` for IPv4 and IPv6.

isEnabledOptional
boolean | IResolvable

A Boolean value indicating whether the distribution is enabled.

tagsOptional
CfnTag[]

An array of key-value pairs to apply to this resource. For more information, see [Tag](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html) in the *AWS CloudFormation User Guide* . > The `Value` of `Tags` is optional for Lightsail resources.

CloudFormation Resource

This L1 construct maps directly to the following CloudFormation resource type.

Learn AWS the Practical Way

Our bi-weekly newsletter teaches hands-on AWS fundamentals. No certification fluff - just practical knowledge.

Subscribe to Newsletter