Skip to content
v2.273.0

CfnDistributionProps Struct ​

Properties for defining a CfnDistribution.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_lightsail as lightsail } from 'aws-cdk-lib';
const cfnDistributionProps: lightsail.CfnDistributionProps = {
  bundleId: 'bundleId',
  defaultCacheBehavior: {
    behavior: 'behavior',
  },
  distributionName: 'distributionName',
  origin: {
    name: 'name',
    protocolPolicy: 'protocolPolicy',
    regionName: 'regionName',
  },

  // the properties below are optional
  cacheBehaviors: [{
    behavior: 'behavior',
    path: 'path',
  }],
  cacheBehaviorSettings: {
    allowedHttpMethods: 'allowedHttpMethods',
    cachedHttpMethods: 'cachedHttpMethods',
    defaultTtl: 123,
    forwardedCookies: {
      cookiesAllowList: ['cookiesAllowList'],
      option: 'option',
    },
    forwardedHeaders: {
      headersAllowList: ['headersAllowList'],
      option: 'option',
    },
    forwardedQueryStrings: {
      option: false,
      queryStringsAllowList: ['queryStringsAllowList'],
    },
    maximumTtl: 123,
    minimumTtl: 123,
  },
  certificateName: 'certificateName',
  ipAddressType: 'ipAddressType',
  isEnabled: false,
  tags: [{
    key: 'key',
    value: 'value',
  }],
};

Properties ​

bundleIdstringbundle_idstrbundleIdStringBundleIdstringBundleId*stringrequired#
The ID of the bundle applied to the distribution.
cacheBehaviorsIResolvable | IResolvable | CfnDistribution.CacheBehaviorPerPathProperty[]cache_behaviorstyping.Union[IResolvable, typing.List[typing.Union[IResolvable, CacheBehaviorPerPathProperty]]]cacheBehaviorsIResolvableCacheBehaviorsIResolvableCacheBehaviorsinterface{}#
An array of objects that describe the per-path cache behavior of the distribution.
cacheBehaviorSettingsIResolvable | CfnDistribution.CacheSettingsPropertycache_behavior_settingstyping.Union[IResolvable, CacheSettingsProperty]cacheBehaviorSettingsIResolvableCacheBehaviorSettingsIResolvableCacheBehaviorSettingsinterface{}#
An object that describes the cache behavior settings of the distribution.
certificateNamestringcertificate_namestrcertificateNameStringCertificateNamestringCertificateName*string#
The name of the SSL/TLS certificate attached to the distribution.
defaultCacheBehaviorIResolvable | CfnDistribution.CacheBehaviorPropertydefault_cache_behaviortyping.Union[IResolvable, CacheBehaviorProperty]defaultCacheBehaviorIResolvableDefaultCacheBehaviorIResolvableDefaultCacheBehaviorinterface{}required#
An object that describes the default cache behavior of the distribution.
distributionNamestringdistribution_namestrdistributionNameStringDistributionNamestringDistributionName*stringrequired#
The name of the distribution.
ipAddressTypestringip_address_typestripAddressTypeStringIpAddressTypestringIpAddressType*string#
The IP address type of the distribution.

The possible values are ipv4 for IPv4 only, and dualstack for IPv4 and IPv6.

isEnabledboolean | IResolvableis_enabledtyping.Union[bool, IResolvable]isEnabledBooleanIsEnabledboolIsEnabledinterface{}#
A Boolean value indicating whether the distribution is enabled.
originIResolvable | CfnDistribution.InputOriginPropertyorigintyping.Union[IResolvable, InputOriginProperty]originIResolvableOriginIResolvableOrigininterface{}required#
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.

tagsCfnTag[]tagstyping.List[CfnTag]tagsList<CfnTag>TagsCfnTag[]Tags*[]CfnTag#
An array of key-value pairs to apply to this resource.

For more information, see Tag in the AWS CloudFormation User Guide .

The Value of Tags is optional for Lightsail resources.

Used as props by ​