AddBehaviorOptions

class aws_cdk.aws_cloudfront.AddBehaviorOptions(*, allowed_methods=None, cached_methods=None, compress=None, edge_lambdas=None, forward_query_string=None, forward_query_string_cache_keys=None, smooth_streaming=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_HEAD

  • cached_methods (Optional[CachedMethods]) – HTTP methods to cache for this behavior. Default: CachedMethods.CACHE_GET_HEAD

  • compress (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: false

  • edge_lambdas (Optional[List[EdgeLambda]]) – The Lambda@Edge functions to invoke before serving the contents. Default: - no Lambda functions will be invoked

  • forward_query_string (Optional[bool]) – Whether CloudFront will forward query strings to the origin. If this is set to true, CloudFront will forward all query parameters to the origin, and cache based on all parameters. See forwardQueryStringCacheKeys for a way to limit the query parameters CloudFront caches on. Default: false

  • forward_query_string_cache_keys (Optional[List[str]]) – A set of query string parameter names to use for caching if forwardQueryString is set to true. Default: []

  • smooth_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: false

  • viewer_protocol_policy (Optional[ViewerProtocolPolicy]) – The protocol that viewers can use to access the files controlled by this behavior. Default: ViewerProtocolPolicy.ALLOW_ALL

stability :stability: experimental

Attributes

allowed_methods

HTTP methods to allow for this behavior.

default :default: AllowedMethods.ALLOW_GET_HEAD

stability :stability: experimental

Return type

Optional[AllowedMethods]

cached_methods

HTTP methods to cache for this behavior.

default :default: CachedMethods.CACHE_GET_HEAD

stability :stability: experimental

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 :default: false

stability :stability: experimental

Return type

Optional[bool]

edge_lambdas

The Lambda@Edge functions to invoke before serving the contents.

default :default: - no Lambda functions will be invoked

see :see: https://aws.amazon.com/lambda/edge stability :stability: experimental

Return type

Optional[List[EdgeLambda]]

forward_query_string

Whether CloudFront will forward query strings to the origin.

If this is set to true, CloudFront will forward all query parameters to the origin, and cache based on all parameters. See forwardQueryStringCacheKeys for a way to limit the query parameters CloudFront caches on.

default :default: false

stability :stability: experimental

Return type

Optional[bool]

forward_query_string_cache_keys

A set of query string parameter names to use for caching if forwardQueryString is set to true.

default :default: []

stability :stability: experimental

Return type

Optional[List[str]]

smooth_streaming

Set this to true to indicate you want to distribute media files in the Microsoft Smooth Streaming format using this behavior.

default :default: false

stability :stability: experimental

Return type

Optional[bool]

viewer_protocol_policy

The protocol that viewers can use to access the files controlled by this behavior.

default :default: ViewerProtocolPolicy.ALLOW_ALL

stability :stability: experimental

Return type

Optional[ViewerProtocolPolicy]