AddBehaviorOptions¶
-
class
aws_cdk.aws_cloudfront.
AddBehaviorOptions
(*, allowed_methods=None, cached_methods=None, cache_policy=None, compress=None, edge_lambdas=None, origin_request_policy=None, smooth_streaming=None, trusted_key_groups=None, viewer_protocol_policy=None)¶ Bases:
object
Options for adding a new behavior to a Distribution.
- Parameters
allowed_methods (
Optional
[AllowedMethods
]) – HTTP methods to allow for this behavior. Default: AllowedMethods.ALLOW_GET_HEADcached_methods (
Optional
[CachedMethods
]) – HTTP methods to cache for this behavior. Default: CachedMethods.CACHE_GET_HEADcache_policy (
Optional
[ICachePolicy
]) – The cache policy for this behavior. The cache policy determines what values are included in the cache key, and the time-to-live (TTL) values for the cache. Default: CachePolicy.CACHING_OPTIMIZEDcompress (
Optional
[bool
]) – Whether you want CloudFront to automatically compress certain files for this cache behavior. See https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/ServingCompressedFiles.html#compressed-content-cloudfront-file-types for file types CloudFront will compress. Default: trueedge_lambdas (
Optional
[List
[EdgeLambda
]]) – The Lambda@Edge functions to invoke before serving the contents. Default: - no Lambda functions will be invokedorigin_request_policy (
Optional
[IOriginRequestPolicy
]) – The origin request policy for this behavior. The origin request policy determines which values (e.g., headers, cookies) are included in requests that CloudFront sends to the origin. Default: - nonesmooth_streaming (
Optional
[bool
]) – Set this to true to indicate you want to distribute media files in the Microsoft Smooth Streaming format using this behavior. Default: falsetrusted_key_groups (
Optional
[List
[IKeyGroup
]]) – A list of Key Groups that CloudFront can use to validate signed URLs or signed cookies. Default: - no KeyGroups are associated with cache behaviorviewer_protocol_policy (
Optional
[ViewerProtocolPolicy
]) – The protocol that viewers can use to access the files controlled by this behavior. Default: ViewerProtocolPolicy.ALLOW_ALL
Attributes
-
allowed_methods
¶ HTTP methods to allow for this behavior.
- Default
AllowedMethods.ALLOW_GET_HEAD
- Return type
Optional
[AllowedMethods
]
-
cache_policy
¶ The cache policy for this behavior.
The cache policy determines what values are included in the cache key, and the time-to-live (TTL) values for the cache.
- Default
CachePolicy.CACHING_OPTIMIZED
- See
https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-the-cache-key.html.
- Return type
Optional
[ICachePolicy
]
-
cached_methods
¶ HTTP methods to cache for this behavior.
- Default
CachedMethods.CACHE_GET_HEAD
- Return type
Optional
[CachedMethods
]
-
compress
¶ Whether you want CloudFront to automatically compress certain files for this cache behavior.
See https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/ServingCompressedFiles.html#compressed-content-cloudfront-file-types for file types CloudFront will compress.
- Default
true
- Return type
Optional
[bool
]
-
edge_lambdas
¶ The Lambda@Edge functions to invoke before serving the contents.
- Default
no Lambda functions will be invoked
- See
- Return type
Optional
[List
[EdgeLambda
]]
-
origin_request_policy
¶ The origin request policy for this behavior.
The origin request policy determines which values (e.g., headers, cookies) are included in requests that CloudFront sends to the origin.
- Default
none
- Return type
Optional
[IOriginRequestPolicy
]
-
smooth_streaming
¶ Set this to true to indicate you want to distribute media files in the Microsoft Smooth Streaming format using this behavior.
- Default
false
- Return type
Optional
[bool
]
-
trusted_key_groups
¶ A list of Key Groups that CloudFront can use to validate signed URLs or signed cookies.
- Default
no KeyGroups are associated with cache behavior
- See
https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/PrivateContent.html
- Return type
Optional
[List
[IKeyGroup
]]
-
viewer_protocol_policy
¶ The protocol that viewers can use to access the files controlled by this behavior.
- Default
ViewerProtocolPolicy.ALLOW_ALL
- Return type
Optional
[ViewerProtocolPolicy
]