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:
CfnResource
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.
- See:
- CloudformationResource:
AWS::Lightsail::Distribution
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import 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" )] )
- Parameters:
scope (
Construct
) – Scope in which this resource is defined.id (
str
) – Construct identifier for this resource (unique in its scope).bundle_id (
str
) – The ID of the bundle applied to the distribution.default_cache_behavior (
Union
[IResolvable
,CacheBehaviorProperty
,Dict
[str
,Any
]]) – An object that describes the default cache behavior of the distribution.distribution_name (
str
) – The name of the distribution.origin (
Union
[IResolvable
,InputOriginProperty
,Dict
[str
,Any
]]) – 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
,Dict
[str
,Any
]]],None
]) – An array of objects that describe the per-path cache behavior of the distribution.cache_behavior_settings (
Union
[IResolvable
,CacheSettingsProperty
,Dict
[str
,Any
],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 areipv4
for IPv4 only, anddualstack
for IPv4 and IPv6.is_enabled (
Union
[bool
,IResolvable
,None
]) – A Boolean value indicating whether the distribution is enabled.tags (
Optional
[Sequence
[Union
[CfnTag
,Dict
[str
,Any
]]]]) – An array of key-value pairs to apply to this resource. For more information, see Tag in the AWS CloudFormation User Guide . .. epigraph:: TheValue
ofTags
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_dependency(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_depends_on(target)
(deprecated) Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
- Parameters:
target (
CfnResource
) –- Deprecated:
use addDependency
- Stability:
deprecated
- Return type:
None
- add_metadata(key, value)
Add a value to the CloudFormation Resource Metadata.
- Parameters:
key (
str
) –value (
Any
) –
- See:
- Return type:
None
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.
- add_override(path, value)
Adds an override to the synthesized CloudFormation resource.
To add a property override, either use
addPropertyOverride
or prefixpath
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 toaddOverride
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 intermediate 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
). In some cases, a snapshot can be taken of the resource prior to deletion (RemovalPolicy.SNAPSHOT
). A list of resources that support this policy can be found in the following link:- Parameters:
policy (
Optional
[RemovalPolicy
]) –apply_to_update_replace_policy (
Optional
[bool
]) – Apply the same deletion policy to the resource’s “UpdateReplacePolicy”. Default: truedefault (
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 resource, please consult that specific resource’s documentation.
- See:
- Return type:
None
- get_att(attribute_name, type_hint=None)
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.type_hint (
Optional
[ResolutionTypeHint
]) –
- Return type:
- get_metadata(key)
Retrieve a value value from the CloudFormation Resource Metadata.
- Parameters:
key (
str
) –- See:
- Return type:
Any
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.
- inspect(inspector)
Examines the CloudFormation resource and discloses attributes.
- Parameters:
inspector (
TreeInspector
) – tree inspector to collect and process attributes.- Return type:
None
- obtain_dependencies()
Retrieves an array of resources this resource depends on.
This assembles dependencies on resources across stacks (including nested stacks) automatically.
- Return type:
List
[Union
[Stack
,CfnResource
]]
- obtain_resource_dependencies()
Get a shallow copy of dependencies between this resource and other resources in the same stack.
- Return type:
List
[CfnResource
]
- 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
- remove_dependency(target)
Indicates that this resource no longer depends on another resource.
This can be used for resources across stacks (including nested stacks) and the dependency will automatically be removed from the relevant scope.
- Parameters:
target (
CfnResource
) –- Return type:
None
- replace_dependency(target, new_target)
Replaces one dependency with another.
- Parameters:
target (
CfnResource
) – The dependency to replace.new_target (
CfnResource
) – The new dependency to add.
- 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
- attr_distribution_arn
The Amazon Resource Name (ARN) of the distribution.
- CloudformationAttribute:
DistributionArn
- attr_status
The status of the distribution.
- CloudformationAttribute:
Status
- bundle_id
The ID of the bundle applied to the distribution.
- cache_behavior_settings
An object that describes the cache behavior settings of the distribution.
- cache_behaviors
An array of objects that describe the per-path cache behavior of the distribution.
- certificate_name
The name of the SSL/TLS certificate attached to the distribution.
- cfn_options
Options for this resource, such as condition, update policy etc.
- cfn_resource_type
AWS resource type.
- 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.
- default_cache_behavior
An object that describes the default cache behavior of the distribution.
- distribution_name
The name of the distribution.
- ip_address_type
The IP address type of the distribution.
- is_enabled
A Boolean value indicating whether the distribution is enabled.
- 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)
.- Returns:
the logical ID as a stringified token. This value will only get resolved during synthesis.
- node
The tree node.
- origin
An object that describes the origin resource of the distribution, such as a Lightsail instance, bucket, or load balancer.
- 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 })
.
- stack
The stack in which this element is defined.
CfnElements must be defined within a stack scope (directly or indirectly).
- tags
Tag Manager which manages the tags for this resource.
- tags_raw
An array of key-value pairs to apply to this resource.
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(x)
Check whether the given object is a CfnResource.
- Parameters:
x (
Any
) –- Return type:
bool
- classmethod is_construct(x)
Checks if
x
is a construct.Use this method instead of
instanceof
to properly detectConstruct
instances, even when the construct library is symlinked.Explanation: in JavaScript, multiple copies of the
constructs
library on disk are seen as independent, completely different libraries. As a consequence, the classConstruct
in each copy of theconstructs
library is seen as a different class, and an instance of one class will not test asinstanceof
the other class.npm install
will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of theconstructs
library can be accidentally installed, andinstanceof
will behave unpredictably. It is safest to avoid usinginstanceof
, and using this type-testing method instead.- Parameters:
x (
Any
) – Any object.- Return type:
bool
- Returns:
true if
x
is an object created from a class which extendsConstruct
.
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
tocache
, 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 todont-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/
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import 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.
- 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/
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’sCacheBehaviorPerPath
parameter. This behavior is ideal for websites or web applications that use cookies, headers, and query strings to personalize content for individual users.- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import 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.
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 aBehavior
ofcache
. This includes theDefaultCacheBehavior
.- 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 theGET
andHEAD
methods. -GET,HEAD,OPTIONS
- The distribution forwards theGET
,HEAD
, andOPTIONS
methods. -GET,HEAD,OPTIONS,PUT,PATCH,POST,DELETE
- The distribution forwards theGET
,HEAD
,OPTIONS
,PUT
,PATCH
,POST
, andDELETE
methods. If you specifyGET,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 theGET
andHEAD
methods. -GET,HEAD,OPTIONS
- The distribution caches responses to theGET
,HEAD
, andOPTIONS
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 asCache-Control max-age
,Cache-Control s-maxage
, andExpires
to objects.forwarded_cookies (
Union
[IResolvable
,CookieObjectProperty
,Dict
[str
,Any
],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
,Dict
[str
,Any
],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
,Dict
[str
,Any
],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 asCache-Control max-age
,Cache-Control s-maxage
, andExpires
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 of0
must be specified forminimumTTL
if the distribution is configured to forward all headers to the origin.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import 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 theGET
andHEAD
methods.GET,HEAD,OPTIONS
- The distribution forwards theGET
,HEAD
, andOPTIONS
methods.GET,HEAD,OPTIONS,PUT,PATCH,POST,DELETE
- The distribution forwards theGET
,HEAD
,OPTIONS
,PUT
,PATCH
,POST
, andDELETE
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
The HTTP method responses that are cached by your distribution.
You can specify the following options:
GET,HEAD
- The distribution caches responses to theGET
andHEAD
methods.GET,HEAD,OPTIONS
- The distribution caches responses to theGET
,HEAD
, andOPTIONS
methods.
- 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
, andExpires
to objects.
- 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.
- 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.
- 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.
- 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
, andExpires
to objects.
- 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 forminimumTTL
if the distribution is configured to forward all headers to the origin.
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 theHeadersAllowList
parameter.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import 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.
- 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.
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.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import 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.
- protocol_policy
The protocol that your Amazon Lightsail distribution uses when establishing a connection with your origin to pull content.
- region_name
The AWS Region name of the origin resource.
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 theoption
parameter is true, then your distribution forwards all query strings, regardless of what you specify using theQueryStringsAllowList
parameter.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import 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.
- 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 theQueryStringsAllowList
parameter.