CfnDistribution

class aws_cdk.aws_lightsail.CfnDistribution(scope, id, *, bundle_id, default_cache_behavior, distribution_name, origin, cache_behaviors=None, cache_behavior_settings=None, certificate_name=None, ip_address_type=None, is_enabled=None, tags=None)

Bases: aws_cdk.core.CfnResource

A CloudFormation AWS::Lightsail::Distribution.

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.

CloudformationResource

AWS::Lightsail::Distribution

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lightsail-distribution.html

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_lightsail as lightsail

cfn_distribution = lightsail.CfnDistribution(self, "MyCfnDistribution",
    bundle_id="bundleId",
    default_cache_behavior=lightsail.CfnDistribution.CacheBehaviorProperty(
        behavior="behavior"
    ),
    distribution_name="distributionName",
    origin=lightsail.CfnDistribution.InputOriginProperty(
        name="name",
        protocol_policy="protocolPolicy",
        region_name="regionName"
    ),

    # the properties below are optional
    cache_behaviors=[lightsail.CfnDistribution.CacheBehaviorPerPathProperty(
        behavior="behavior",
        path="path"
    )],
    cache_behavior_settings=lightsail.CfnDistribution.CacheSettingsProperty(
        allowed_http_methods="allowedHttpMethods",
        cached_http_methods="cachedHttpMethods",
        default_ttl=123,
        forwarded_cookies=lightsail.CfnDistribution.CookieObjectProperty(
            cookies_allow_list=["cookiesAllowList"],
            option="option"
        ),
        forwarded_headers=lightsail.CfnDistribution.HeaderObjectProperty(
            headers_allow_list=["headersAllowList"],
            option="option"
        ),
        forwarded_query_strings=lightsail.CfnDistribution.QueryStringObjectProperty(
            option=False,
            query_strings_allow_list=["queryStringsAllowList"]
        ),
        maximum_ttl=123,
        minimum_ttl=123
    ),
    certificate_name="certificateName",
    ip_address_type="ipAddressType",
    is_enabled=False,
    tags=[CfnTag(
        key="key",
        value="value"
    )]
)

Create a new AWS::Lightsail::Distribution.

Parameters
  • scope (Construct) –

    • scope in which this resource is defined.

  • id (str) –

    • scoped id of the resource.

  • bundle_id (str) – The ID of the bundle applied to the distribution.

  • default_cache_behavior (Union[IResolvable, CacheBehaviorProperty]) – An object that describes the default cache behavior of the distribution.

  • distribution_name (str) – The name of the distribution.

  • origin (Union[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.

  • cache_behaviors (Union[IResolvable, Sequence[Union[IResolvable, CacheBehaviorPerPathProperty]], None]) – An array of objects that describe the per-path cache behavior of the distribution.

  • cache_behavior_settings (Union[IResolvable, CacheSettingsProperty, None]) – An object that describes the cache behavior settings of the distribution.

  • certificate_name (Optional[str]) – The name of the SSL/TLS certificate attached to the distribution.

  • ip_address_type (Optional[str]) – The IP address type of the distribution. The possible values are ipv4 for IPv4 only, and dualstack for IPv4 and IPv6.

  • is_enabled (Union[bool, IResolvable, None]) – A Boolean value indicating whether the distribution is enabled.

  • tags (Optional[Sequence[CfnTag]]) – An array of key-value pairs to apply to this resource. For more information, see Tag in the AWS CloudFormation User Guide . .. epigraph:: The Value of Tags is optional for Lightsail resources.

Methods

add_deletion_override(path)

Syntactic sugar for addOverride(path, undefined).

Parameters

path (str) – The path of the value to delete.

Return type

None

add_depends_on(target)

Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.

This can be used for resources across stacks (or nested stack) boundaries and the dependency will automatically be transferred to the relevant scope.

Parameters

target (CfnResource) –

Return type

None

add_metadata(key, value)

Add a value to the CloudFormation Resource Metadata.

Parameters
  • key (str) –

  • value (Any) –

See

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html

Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.

Return type

None

add_override(path, value)

Adds an override to the synthesized CloudFormation resource.

To add a property override, either use addPropertyOverride or prefix path with “Properties.” (i.e. Properties.TopicName).

If the override is nested, separate each nested level using a dot (.) in the path parameter. If there is an array as part of the nesting, specify the index in the path.

To include a literal . in the property name, prefix with a \. In most programming languages you will need to write this as "\\." because the \ itself will need to be escaped.

For example:

cfn_resource.add_override("Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes", ["myattribute"])
cfn_resource.add_override("Properties.GlobalSecondaryIndexes.1.ProjectionType", "INCLUDE")

would add the overrides Example:

"Properties": {
   "GlobalSecondaryIndexes": [
     {
       "Projection": {
         "NonKeyAttributes": [ "myattribute" ]
         ...
       }
       ...
     },
     {
       "ProjectionType": "INCLUDE"
       ...
     },
   ]
   ...
}

The value argument to addOverride will not be processed or translated in any way. Pass raw JSON values in here with the correct capitalization for CloudFormation. If you pass CDK classes or structs, they will be rendered with lowercased key names, and CloudFormation will reject the template.

Parameters
  • path (str) –

    • The path of the property, you can use dot notation to override values in complex types. Any intermdediate keys will be created as needed.

  • value (Any) –

    • The value. Could be primitive or complex.

Return type

None

add_property_deletion_override(property_path)

Adds an override that deletes the value of a property from the resource definition.

Parameters

property_path (str) – The path to the property.

Return type

None

add_property_override(property_path, value)

Adds an override to a resource property.

Syntactic sugar for addOverride("Properties.<...>", value).

Parameters
  • property_path (str) – The path of the property.

  • value (Any) – The value.

Return type

None

apply_removal_policy(policy=None, *, apply_to_update_replace_policy=None, default=None)

Sets the deletion policy of the resource based on the removal policy specified.

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you’ve removed it from the CDK application or because you’ve made a change that requires the resource to be replaced.

The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN).

Parameters
  • policy (Optional[RemovalPolicy]) –

  • apply_to_update_replace_policy (Optional[bool]) – Apply the same deletion policy to the resource’s “UpdateReplacePolicy”. Default: true

  • default (Optional[RemovalPolicy]) – The default policy to apply in case the removal policy is not defined. Default: - Default value is resource specific. To determine the default value for a resoure, please consult that specific resource’s documentation.

Return type

None

get_att(attribute_name)

Returns a token for an runtime attribute of this resource.

Ideally, use generated attribute accessors (e.g. resource.arn), but this can be used for future compatibility in case there is no generated attribute.

Parameters

attribute_name (str) – The name of the attribute.

Return type

Reference

get_metadata(key)

Retrieve a value value from the CloudFormation Resource Metadata.

Parameters

key (str) –

See

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html

Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.

Return type

Any

inspect(inspector)

Examines the CloudFormation resource and discloses attributes.

Parameters

inspector (TreeInspector) –

  • tree inspector to collect and process attributes.

Return type

None

override_logical_id(new_logical_id)

Overrides the auto-generated logical ID with a specific ID.

Parameters

new_logical_id (str) – The new logical ID to use for this stack element.

Return type

None

to_string()

Returns a string representation of this construct.

Return type

str

Returns

a string representation of this resource

Attributes

CFN_RESOURCE_TYPE_NAME = 'AWS::Lightsail::Distribution'
attr_able_to_update_bundle

Indicates whether you can update the distribution’s current bundle to another bundle.

CloudformationAttribute

AbleToUpdateBundle

Return type

IResolvable

attr_distribution_arn

The Amazon Resource Name (ARN) of the distribution.

CloudformationAttribute

DistributionArn

Return type

str

attr_status

The status of the distribution.

CloudformationAttribute

Status

Return type

str

bundle_id

The ID of the bundle applied to the distribution.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lightsail-distribution.html#cfn-lightsail-distribution-bundleid

Return type

str

cache_behavior_settings

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

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lightsail-distribution.html#cfn-lightsail-distribution-cachebehaviorsettings

Return type

Union[IResolvable, CacheSettingsProperty, None]

cache_behaviors

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

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lightsail-distribution.html#cfn-lightsail-distribution-cachebehaviors

Return type

Union[IResolvable, List[Union[IResolvable, CacheBehaviorPerPathProperty]], None]

certificate_name

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

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lightsail-distribution.html#cfn-lightsail-distribution-certificatename

Return type

Optional[str]

cfn_options

Options for this resource, such as condition, update policy etc.

Return type

ICfnResourceOptions

cfn_resource_type

AWS resource type.

Return type

str

creation_stack

return:

the stack trace of the point where this Resource was created from, sourced from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most node +internal+ entries filtered.

Return type

List[str]

default_cache_behavior

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

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lightsail-distribution.html#cfn-lightsail-distribution-defaultcachebehavior

Return type

Union[IResolvable, CacheBehaviorProperty]

distribution_name

The name of the distribution.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lightsail-distribution.html#cfn-lightsail-distribution-distributionname

Return type

str

ip_address_type

The IP address type of the distribution.

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

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lightsail-distribution.html#cfn-lightsail-distribution-ipaddresstype

Return type

Optional[str]

is_enabled

A Boolean value indicating whether the distribution is enabled.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lightsail-distribution.html#cfn-lightsail-distribution-isenabled

Return type

Union[bool, IResolvable, None]

logical_id

The logical ID for this CloudFormation stack element.

The logical ID of the element is calculated from the path of the resource node in the construct tree.

To override this value, use overrideLogicalId(newLogicalId).

Return type

str

Returns

the logical ID as a stringified token. This value will only get resolved during synthesis.

node

The construct tree node associated with this construct.

Return type

ConstructNode

origin

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.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lightsail-distribution.html#cfn-lightsail-distribution-origin

Return type

Union[IResolvable, InputOriginProperty]

ref

Return a string that will be resolved to a CloudFormation { Ref } for this element.

If, by any chance, the intrinsic reference of a resource is not a string, you could coerce it to an IResolvable through Lazy.any({ produce: resource.ref }).

Return type

str

stack

The stack in which this element is defined.

CfnElements must be defined within a stack scope (directly or indirectly).

Return type

Stack

tags

An array of key-value pairs to apply to this resource.

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

The ``Value`` of ``Tags`` is optional for Lightsail resources.
Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lightsail-distribution.html#cfn-lightsail-distribution-tags

Return type

TagManager

Static Methods

classmethod is_cfn_element(x)

Returns true if a construct is a stack element (i.e. part of the synthesized cloudformation template).

Uses duck-typing instead of instanceof to allow stack elements from different versions of this library to be included in the same stack.

Parameters

x (Any) –

Return type

bool

Returns

The construct as a stack element or undefined if it is not a stack element.

classmethod is_cfn_resource(construct)

Check whether the given construct is a CfnResource.

Parameters

construct (IConstruct) –

Return type

bool

classmethod is_construct(x)

Return whether the given object is a Construct.

Parameters

x (Any) –

Return type

bool

CacheBehaviorPerPathProperty

class CfnDistribution.CacheBehaviorPerPathProperty(*, behavior=None, path=None)

Bases: object

CacheBehaviorPerPath is a property of the AWS::Lightsail::Distribution resource. It describes the per-path cache behavior of an Amazon Lightsail content delivery network (CDN) distribution.

Use a per-path cache behavior to override the default cache behavior of a distribution, or to add an exception to it. For example, if you set the CacheBehavior to cache , you can use a per-path cache behavior to specify a directory, file, or file type that your distribution will cache. If you don’t want your distribution to cache a specified directory, file, or file type, set the per-path cache behavior to dont-cache .

Parameters
  • behavior (Optional[str]) – The cache behavior for the specified path. You can specify one of the following per-path cache behaviors: - ``cache`` - This behavior caches the specified path. - ``dont-cache`` - This behavior doesn’t cache the specified path.

  • path (Optional[str]) – The path to a directory or file to cache, or not cache. Use an asterisk symbol to specify wildcard directories ( path/to/assets/* ), and file types ( *.html , *jpg , *js ). Directories and file paths are case-sensitive. Examples: - Specify the following to cache all files in the document root of an Apache web server running on a instance. var/www/html/ - Specify the following file to cache only the index page in the document root of an Apache web server. var/www/html/index.html - Specify the following to cache only the .html files in the document root of an Apache web server. var/www/html/*.html - Specify the following to cache only the .jpg, .png, and .gif files in the images sub-directory of the document root of an Apache web server. var/www/html/images/*.jpg var/www/html/images/*.png var/www/html/images/*.gif Specify the following to cache all files in the images subdirectory of the document root of an Apache web server. var/www/html/images/

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-distribution-cachebehaviorperpath.html

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_lightsail as lightsail

cache_behavior_per_path_property = lightsail.CfnDistribution.CacheBehaviorPerPathProperty(
    behavior="behavior",
    path="path"
)

Attributes

behavior

The cache behavior for the specified path.

You can specify one of the following per-path cache behaviors:

  • ``cache`` - This behavior caches the specified path.

  • ``dont-cache`` - This behavior doesn’t cache the specified path.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-distribution-cachebehaviorperpath.html#cfn-lightsail-distribution-cachebehaviorperpath-behavior

Return type

Optional[str]

path

The path to a directory or file to cache, or not cache.

Use an asterisk symbol to specify wildcard directories ( path/to/assets/* ), and file types ( *.html , *jpg , *js ). Directories and file paths are case-sensitive.

Examples:

  • Specify the following to cache all files in the document root of an Apache web server running on a instance.

var/www/html/

  • Specify the following file to cache only the index page in the document root of an Apache web server.

var/www/html/index.html

  • Specify the following to cache only the .html files in the document root of an Apache web server.

var/www/html/*.html

  • Specify the following to cache only the .jpg, .png, and .gif files in the images sub-directory of the document root of an Apache web server.

var/www/html/images/*.jpg

var/www/html/images/*.png

var/www/html/images/*.gif

Specify the following to cache all files in the images subdirectory of the document root of an Apache web server.

var/www/html/images/

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-distribution-cachebehaviorperpath.html#cfn-lightsail-distribution-cachebehaviorperpath-path

Return type

Optional[str]

CacheBehaviorProperty

class CfnDistribution.CacheBehaviorProperty(*, behavior=None)

Bases: object

CacheBehavior is a property of the AWS::Lightsail::Distribution resource. It describes the default cache behavior of an Amazon Lightsail content delivery network (CDN) distribution.

Parameters

behavior (Optional[str]) – The cache behavior of the distribution. The following cache behaviors can be specified: - ``cache`` - This option is best for static sites. When specified, your distribution caches and serves your entire website as static content. This behavior is ideal for websites with static content that doesn’t change depending on who views it, or for websites that don’t use cookies, headers, or query strings to personalize content. - ``dont-cache`` - This option is best for sites that serve a mix of static and dynamic content. When specified, your distribution caches and serves only the content that is specified in the distribution’s CacheBehaviorPerPath parameter. This behavior is ideal for websites or web applications that use cookies, headers, and query strings to personalize content for individual users.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-distribution-cachebehavior.html

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_lightsail as lightsail

cache_behavior_property = lightsail.CfnDistribution.CacheBehaviorProperty(
    behavior="behavior"
)

Attributes

behavior

The cache behavior of the distribution.

The following cache behaviors can be specified:

  • ``cache`` - This option is best for static sites. When specified, your distribution caches and serves your entire website as static content. This behavior is ideal for websites with static content that doesn’t change depending on who views it, or for websites that don’t use cookies, headers, or query strings to personalize content.

  • ``dont-cache`` - This option is best for sites that serve a mix of static and dynamic content. When specified, your distribution caches and serves only the content that is specified in the distribution’s CacheBehaviorPerPath parameter. This behavior is ideal for websites or web applications that use cookies, headers, and query strings to personalize content for individual users.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-distribution-cachebehavior.html#cfn-lightsail-distribution-cachebehavior-behavior

Return type

Optional[str]

CacheSettingsProperty

class CfnDistribution.CacheSettingsProperty(*, allowed_http_methods=None, cached_http_methods=None, default_ttl=None, forwarded_cookies=None, forwarded_headers=None, forwarded_query_strings=None, maximum_ttl=None, minimum_ttl=None)

Bases: object

CacheSettings is a property of the AWS::Lightsail::Distribution resource. It describes the cache settings of an Amazon Lightsail content delivery network (CDN) distribution.

These settings apply only to your distribution’s CacheBehaviors that have a Behavior of cache . This includes the DefaultCacheBehavior .

Parameters
  • allowed_http_methods (Optional[str]) – The HTTP methods that are processed and forwarded to the distribution’s origin. You can specify the following options: - GET,HEAD - The distribution forwards the GET and HEAD methods. - GET,HEAD,OPTIONS - The distribution forwards the GET , HEAD , and OPTIONS methods. - GET,HEAD,OPTIONS,PUT,PATCH,POST,DELETE - The distribution forwards the GET , HEAD , OPTIONS , PUT , PATCH , POST , and DELETE methods. If you specify GET,HEAD,OPTIONS,PUT,PATCH,POST,DELETE , you might need to restrict access to your distribution’s origin so users can’t perform operations that you don’t want them to. For example, you might not want users to have permission to delete objects from your origin.

  • cached_http_methods (Optional[str]) – The HTTP method responses that are cached by your distribution. You can specify the following options: - GET,HEAD - The distribution caches responses to the GET and HEAD methods. - GET,HEAD,OPTIONS - The distribution caches responses to the GET , HEAD , and OPTIONS methods.

  • default_ttl (Union[int, float, None]) – The default amount of time that objects stay in the distribution’s cache before the distribution forwards another request to the origin to determine whether the content has been updated. .. epigraph:: The value specified applies only when the origin does not add HTTP headers such as Cache-Control max-age , Cache-Control s-maxage , and Expires to objects.

  • forwarded_cookies (Union[IResolvable, CookieObjectProperty, None]) – An object that describes the cookies that are forwarded to the origin. Your content is cached based on the cookies that are forwarded.

  • forwarded_headers (Union[IResolvable, HeaderObjectProperty, None]) – An object that describes the headers that are forwarded to the origin. Your content is cached based on the headers that are forwarded.

  • forwarded_query_strings (Union[IResolvable, QueryStringObjectProperty, None]) – An object that describes the query strings that are forwarded to the origin. Your content is cached based on the query strings that are forwarded.

  • maximum_ttl (Union[int, float, None]) – The maximum amount of time that objects stay in the distribution’s cache before the distribution forwards another request to the origin to determine whether the object has been updated. The value specified applies only when the origin adds HTTP headers such as Cache-Control max-age , Cache-Control s-maxage , and Expires to objects.

  • minimum_ttl (Union[int, float, None]) – The minimum amount of time that objects stay in the distribution’s cache before the distribution forwards another request to the origin to determine whether the object has been updated. A value of 0 must be specified for minimumTTL if the distribution is configured to forward all headers to the origin.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-distribution-cachesettings.html

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_lightsail as lightsail

cache_settings_property = lightsail.CfnDistribution.CacheSettingsProperty(
    allowed_http_methods="allowedHttpMethods",
    cached_http_methods="cachedHttpMethods",
    default_ttl=123,
    forwarded_cookies=lightsail.CfnDistribution.CookieObjectProperty(
        cookies_allow_list=["cookiesAllowList"],
        option="option"
    ),
    forwarded_headers=lightsail.CfnDistribution.HeaderObjectProperty(
        headers_allow_list=["headersAllowList"],
        option="option"
    ),
    forwarded_query_strings=lightsail.CfnDistribution.QueryStringObjectProperty(
        option=False,
        query_strings_allow_list=["queryStringsAllowList"]
    ),
    maximum_ttl=123,
    minimum_ttl=123
)

Attributes

allowed_http_methods

The HTTP methods that are processed and forwarded to the distribution’s origin.

You can specify the following options:

  • GET,HEAD - The distribution forwards the GET and HEAD methods.

  • GET,HEAD,OPTIONS - The distribution forwards the GET , HEAD , and OPTIONS methods.

  • GET,HEAD,OPTIONS,PUT,PATCH,POST,DELETE - The distribution forwards the GET , HEAD , OPTIONS , PUT , PATCH , POST , and DELETE methods.

If you specify GET,HEAD,OPTIONS,PUT,PATCH,POST,DELETE , you might need to restrict access to your distribution’s origin so users can’t perform operations that you don’t want them to. For example, you might not want users to have permission to delete objects from your origin.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-distribution-cachesettings.html#cfn-lightsail-distribution-cachesettings-allowedhttpmethods

Return type

Optional[str]

cached_http_methods

The HTTP method responses that are cached by your distribution.

You can specify the following options:

  • GET,HEAD - The distribution caches responses to the GET and HEAD methods.

  • GET,HEAD,OPTIONS - The distribution caches responses to the GET , HEAD , and OPTIONS methods.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-distribution-cachesettings.html#cfn-lightsail-distribution-cachesettings-cachedhttpmethods

Return type

Optional[str]

default_ttl

The default amount of time that objects stay in the distribution’s cache before the distribution forwards another request to the origin to determine whether the content has been updated.

The value specified applies only when the origin does not add HTTP headers such as Cache-Control max-age , Cache-Control s-maxage , and Expires to objects.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-distribution-cachesettings.html#cfn-lightsail-distribution-cachesettings-defaultttl

Return type

Union[int, float, None]

forwarded_cookies

An object that describes the cookies that are forwarded to the origin.

Your content is cached based on the cookies that are forwarded.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-distribution-cachesettings.html#cfn-lightsail-distribution-cachesettings-forwardedcookies

Return type

Union[IResolvable, CookieObjectProperty, None]

forwarded_headers

An object that describes the headers that are forwarded to the origin.

Your content is cached based on the headers that are forwarded.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-distribution-cachesettings.html#cfn-lightsail-distribution-cachesettings-forwardedheaders

Return type

Union[IResolvable, HeaderObjectProperty, None]

forwarded_query_strings

An object that describes the query strings that are forwarded to the origin.

Your content is cached based on the query strings that are forwarded.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-distribution-cachesettings.html#cfn-lightsail-distribution-cachesettings-forwardedquerystrings

Return type

Union[IResolvable, QueryStringObjectProperty, None]

maximum_ttl

The maximum amount of time that objects stay in the distribution’s cache before the distribution forwards another request to the origin to determine whether the object has been updated.

The value specified applies only when the origin adds HTTP headers such as Cache-Control max-age , Cache-Control s-maxage , and Expires to objects.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-distribution-cachesettings.html#cfn-lightsail-distribution-cachesettings-maximumttl

Return type

Union[int, float, None]

minimum_ttl

The minimum amount of time that objects stay in the distribution’s cache before the distribution forwards another request to the origin to determine whether the object has been updated.

A value of 0 must be specified for minimumTTL if the distribution is configured to forward all headers to the origin.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-distribution-cachesettings.html#cfn-lightsail-distribution-cachesettings-minimumttl

Return type

Union[int, float, None]

CookieObjectProperty

class CfnDistribution.CookieObjectProperty(*, cookies_allow_list=None, option=None)

Bases: object

CookieObject is a property of the CacheSettings property. It describes whether an Amazon Lightsail content delivery network (CDN) distribution forwards cookies to the origin and, if so, which ones.

For the cookies that you specify, your distribution caches separate versions of the specified content based on the cookie values in viewer requests.

Parameters
  • cookies_allow_list (Optional[Sequence[str]]) – The specific cookies to forward to your distribution’s origin.

  • option (Optional[str]) – Specifies which cookies to forward to the distribution’s origin for a cache behavior. Use one of the following configurations for your distribution: - ``all`` - Forwards all cookies to your origin. - ``none`` - Doesn’t forward cookies to your origin. - ``allow-list`` - Forwards only the cookies that you specify using the CookiesAllowList parameter.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-distribution-cookieobject.html

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_lightsail as lightsail

cookie_object_property = lightsail.CfnDistribution.CookieObjectProperty(
    cookies_allow_list=["cookiesAllowList"],
    option="option"
)

Attributes

cookies_allow_list

The specific cookies to forward to your distribution’s origin.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-distribution-cookieobject.html#cfn-lightsail-distribution-cookieobject-cookiesallowlist

Return type

Optional[List[str]]

option

Specifies which cookies to forward to the distribution’s origin for a cache behavior.

Use one of the following configurations for your distribution:

  • ``all`` - Forwards all cookies to your origin.

  • ``none`` - Doesn’t forward cookies to your origin.

  • ``allow-list`` - Forwards only the cookies that you specify using the CookiesAllowList parameter.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-distribution-cookieobject.html#cfn-lightsail-distribution-cookieobject-option

Return type

Optional[str]

HeaderObjectProperty

class CfnDistribution.HeaderObjectProperty(*, headers_allow_list=None, option=None)

Bases: object

HeaderObject is a property of the CacheSettings property. It describes the request headers used by your distribution, which caches your content based on the request headers.

For the headers that you specify, your distribution caches separate versions of the specified content based on the header values in viewer requests. For example, suppose that viewer requests for logo.jpg contain a custom product header that has a value of either acme or apex. Also, suppose that you configure your distribution to cache your content based on values in the product header. Your distribution forwards the product header to the origin and caches the response from the origin once for each header value.

Parameters
  • headers_allow_list (Optional[Sequence[str]]) – The specific headers to forward to your distribution’s origin.

  • option (Optional[str]) – The headers that you want your distribution to forward to your origin. Your distribution caches your content based on these headers. Use one of the following configurations for your distribution: - ``all`` - Forwards all headers to your origin.. - ``none`` - Forwards only the default headers. - ``allow-list`` - Forwards only the headers that you specify using the HeadersAllowList parameter.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-distribution-headerobject.html

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_lightsail as lightsail

header_object_property = lightsail.CfnDistribution.HeaderObjectProperty(
    headers_allow_list=["headersAllowList"],
    option="option"
)

Attributes

headers_allow_list

The specific headers to forward to your distribution’s origin.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-distribution-headerobject.html#cfn-lightsail-distribution-headerobject-headersallowlist

Return type

Optional[List[str]]

option

The headers that you want your distribution to forward to your origin.

Your distribution caches your content based on these headers.

Use one of the following configurations for your distribution:

  • ``all`` - Forwards all headers to your origin..

  • ``none`` - Forwards only the default headers.

  • ``allow-list`` - Forwards only the headers that you specify using the HeadersAllowList parameter.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-distribution-headerobject.html#cfn-lightsail-distribution-headerobject-option

Return type

Optional[str]

InputOriginProperty

class CfnDistribution.InputOriginProperty(*, name=None, protocol_policy=None, region_name=None)

Bases: object

InputOrigin is a property of the AWS::Lightsail::Distribution resource. It describes the origin resource of an Amazon Lightsail content delivery network (CDN) distribution.

An origin can be a instance, bucket, or load balancer. A distribution pulls content from an origin, caches it, and serves it to viewers through a worldwide network of edge servers.

Parameters
  • name (Optional[str]) – The name of the origin resource.

  • protocol_policy (Optional[str]) – The protocol that your Amazon Lightsail distribution uses when establishing a connection with your origin to pull content.

  • region_name (Optional[str]) – The AWS Region name of the origin resource.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-distribution-inputorigin.html

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_lightsail as lightsail

input_origin_property = lightsail.CfnDistribution.InputOriginProperty(
    name="name",
    protocol_policy="protocolPolicy",
    region_name="regionName"
)

Attributes

name

The name of the origin resource.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-distribution-inputorigin.html#cfn-lightsail-distribution-inputorigin-name

Return type

Optional[str]

protocol_policy

The protocol that your Amazon Lightsail distribution uses when establishing a connection with your origin to pull content.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-distribution-inputorigin.html#cfn-lightsail-distribution-inputorigin-protocolpolicy

Return type

Optional[str]

region_name

The AWS Region name of the origin resource.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-distribution-inputorigin.html#cfn-lightsail-distribution-inputorigin-regionname

Return type

Optional[str]

QueryStringObjectProperty

class CfnDistribution.QueryStringObjectProperty(*, option=None, query_strings_allow_list=None)

Bases: object

QueryStringObject is a property of the CacheSettings property. It describes the query string parameters that an Amazon Lightsail content delivery network (CDN) distribution to bases caching on.

For the query strings that you specify, your distribution caches separate versions of the specified content based on the query string values in viewer requests.

Parameters
  • option (Union[bool, IResolvable, None]) – Indicates whether the distribution forwards and caches based on query strings.

  • query_strings_allow_list (Optional[Sequence[str]]) – The specific query strings that the distribution forwards to the origin. Your distribution caches content based on the specified query strings. If the option parameter is true, then your distribution forwards all query strings, regardless of what you specify using the QueryStringsAllowList parameter.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-distribution-querystringobject.html

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_lightsail as lightsail

query_string_object_property = lightsail.CfnDistribution.QueryStringObjectProperty(
    option=False,
    query_strings_allow_list=["queryStringsAllowList"]
)

Attributes

option

Indicates whether the distribution forwards and caches based on query strings.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-distribution-querystringobject.html#cfn-lightsail-distribution-querystringobject-option

Return type

Union[bool, IResolvable, None]

query_strings_allow_list

The specific query strings that the distribution forwards to the origin.

Your distribution caches content based on the specified query strings.

If the option parameter is true, then your distribution forwards all query strings, regardless of what you specify using the QueryStringsAllowList parameter.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-distribution-querystringobject.html#cfn-lightsail-distribution-querystringobject-querystringsallowlist

Return type

Optional[List[str]]