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, viewer_protocol_policy=None)

Bases: object

(experimental) Options for adding a new behavior to a Distribution.

Parameters
  • allowed_methods (Optional[AllowedMethods]) – (experimental) HTTP methods to allow for this behavior. Default: AllowedMethods.ALLOW_GET_HEAD

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

  • cache_policy (Optional[ICachePolicy]) – (experimental) 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

  • compress (Optional[bool]) – (experimental) 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

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

  • origin_request_policy (Optional[IOriginRequestPolicy]) – (experimental) 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

  • smooth_streaming (Optional[bool]) – (experimental) 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]) – (experimental) The protocol that viewers can use to access the files controlled by this behavior. Default: ViewerProtocolPolicy.ALLOW_ALL

Stability

experimental

Attributes

allowed_methods

(experimental) HTTP methods to allow for this behavior.

Default

AllowedMethods.ALLOW_GET_HEAD

Stability

experimental

Return type

Optional[AllowedMethods]

cache_policy

(experimental) 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.

Stability

experimental

Return type

Optional[ICachePolicy]

cached_methods

(experimental) HTTP methods to cache for this behavior.

Default

CachedMethods.CACHE_GET_HEAD

Stability

experimental

Return type

Optional[CachedMethods]

compress

(experimental) 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

Stability

experimental

Return type

Optional[bool]

edge_lambdas

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

Default
  • no Lambda functions will be invoked

See

https://aws.amazon.com/lambda/edge

Stability

experimental

Return type

Optional[List[EdgeLambda]]

origin_request_policy

(experimental) 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

Stability

experimental

Return type

Optional[IOriginRequestPolicy]

smooth_streaming

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

Default

false

Stability

experimental

Return type

Optional[bool]

viewer_protocol_policy

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

Default

ViewerProtocolPolicy.ALLOW_ALL

Stability

experimental

Return type

Optional[ViewerProtocolPolicy]