Behavior

class aws_cdk.aws_cloudfront.Behavior(*, allowed_methods=None, cached_methods=None, compress=None, default_ttl=None, forwarded_values=None, is_default_behavior=None, lambda_function_associations=None, max_ttl=None, min_ttl=None, path_pattern=None, trusted_signers=None)

Bases: object

(experimental) A CloudFront behavior wrapper.

Parameters
  • allowed_methods (Optional[CloudFrontAllowedMethods]) – (experimental) The method this CloudFront distribution responds do. Default: GET_HEAD

  • cached_methods (Optional[CloudFrontAllowedCachedMethods]) – (experimental) Which methods are cached by CloudFront by default. Default: GET_HEAD

  • compress (Optional[bool]) – (experimental) If CloudFront should automatically compress some content types. Default: true

  • default_ttl (Optional[Duration]) – (experimental) The default amount of time CloudFront will cache an object. This value applies only when your custom origin does not add HTTP headers, such as Cache-Control max-age, Cache-Control s-maxage, and Expires to objects. Default: 86400 (1 day)

  • forwarded_values (Optional[ForwardedValuesProperty]) – (experimental) The values CloudFront will forward to the origin when making a request. Default: none (no cookies - no headers)

  • is_default_behavior (Optional[bool]) – (experimental) If this behavior is the default behavior for the distribution. You must specify exactly one default distribution per CloudFront distribution. The default behavior is allowed to omit the “path” property.

  • lambda_function_associations (Optional[List[LambdaFunctionAssociation]]) – (experimental) Declares associated lambda@edge functions for this distribution behaviour. Default: No lambda function associated

  • max_ttl (Optional[Duration]) – (experimental) The max amount of time you want objects to stay in the cache before CloudFront queries your origin. Default: Duration.seconds(31536000) (one year)

  • min_ttl (Optional[Duration]) – (experimental) The minimum amount of time that you want objects to stay in the cache before CloudFront queries your origin.

  • path_pattern (Optional[str]) – (experimental) The path this behavior responds to. Required for all non-default behaviors. (The default behavior implicitly has “*” as the path pattern. )

  • trusted_signers (Optional[List[str]]) – (experimental) Trusted signers is how CloudFront allows you to serve private content. The signers are the account IDs that are allowed to sign cookies/presigned URLs for this distribution. If you pass a non empty value, all requests for this behavior must be signed (no public access will be allowed)

Stability

experimental

Attributes

allowed_methods

(experimental) The method this CloudFront distribution responds do.

Default

GET_HEAD

Stability

experimental

Return type

Optional[CloudFrontAllowedMethods]

cached_methods

(experimental) Which methods are cached by CloudFront by default.

Default

GET_HEAD

Stability

experimental

Return type

Optional[CloudFrontAllowedCachedMethods]

compress

(experimental) If CloudFront should automatically compress some content types.

Default

true

Stability

experimental

Return type

Optional[bool]

default_ttl

(experimental) The default amount of time CloudFront will cache an object.

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

Default

86400 (1 day)

Stability

experimental

Return type

Optional[Duration]

forwarded_values

(experimental) The values CloudFront will forward to the origin when making a request.

Default

none (no cookies - no headers)

Stability

experimental

Return type

Optional[ForwardedValuesProperty]

is_default_behavior

(experimental) If this behavior is the default behavior for the distribution.

You must specify exactly one default distribution per CloudFront distribution. The default behavior is allowed to omit the “path” property.

Stability

experimental

Return type

Optional[bool]

lambda_function_associations

(experimental) Declares associated lambda@edge functions for this distribution behaviour.

Default

No lambda function associated

Stability

experimental

Return type

Optional[List[LambdaFunctionAssociation]]

max_ttl

(experimental) The max amount of time you want objects to stay in the cache before CloudFront queries your origin.

Default

Duration.seconds(31536000) (one year)

Stability

experimental

Return type

Optional[Duration]

min_ttl

(experimental) The minimum amount of time that you want objects to stay in the cache before CloudFront queries your origin.

Stability

experimental

Return type

Optional[Duration]

path_pattern

(experimental) The path this behavior responds to.

Required for all non-default behaviors. (The default behavior implicitly has “*” as the path pattern. )

Stability

experimental

Return type

Optional[str]

trusted_signers

(experimental) Trusted signers is how CloudFront allows you to serve private content.

The signers are the account IDs that are allowed to sign cookies/presigned URLs for this distribution.

If you pass a non empty value, all requests for this behavior must be signed (no public access will be allowed)

Stability

experimental

Return type

Optional[List[str]]