CfnDistributionLogsMixin

class aws_cdk.mixins_preview.aws_cloudfront.mixins.CfnDistributionLogsMixin(log_type, log_delivery)

Bases: Mixin

A distribution tells CloudFront where you want content to be delivered from, and the details about how to track and manage content delivery.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-distribution.html

CloudformationResource:

AWS::CloudFront::Distribution

Mixin:

true

ExampleMetadata:

infused

Example:

from aws_cdk.mixins_preview.with import
import aws_cdk.mixins_preview.aws_cloudfront.mixins as cloudfront_mixins

# Create CloudFront distribution
# bucket: s3.Bucket

distribution = cloudfront.Distribution(scope, "Distribution",
    default_behavior=cloudfront.BehaviorOptions(
        origin=origins.S3BucketOrigin.with_origin_access_control(bucket)
    )
)

# Create log destination
log_group = logs.LogGroup(scope, "DeliveryLogGroup")

# Configure log delivery using the mixin
distribution.with(cloudfront_mixins.CfnDistributionLogsMixin.CONNECTION_LOGS.to_log_group(log_group))

Create a mixin to enable vended logs for AWS::CloudFront::Distribution.

Parameters:
  • log_type (str) – Type of logs that are getting vended.

  • log_delivery (ILogsDelivery) – Object in charge of setting up the delivery destination and delivery connection.

Methods

apply_to(resource)

Apply vended logs configuration to the construct.

Parameters:

resource (IConstruct)

Return type:

IConstruct

supports(construct)

Check if this mixin supports the given construct (has vendedLogs property).

Parameters:

construct (IConstruct)

Return type:

bool

Attributes

ACCESS_LOGS = <aws_cdk.mixins_preview.aws_cloudfront.mixins.CfnDistributionAccessLogs object>
CONNECTION_LOGS = <aws_cdk.mixins_preview.aws_cloudfront.mixins.CfnDistributionConnectionLogs object>

Static Methods

classmethod is_mixin(x)

(experimental) Checks if x is a Mixin.

Parameters:

x (Any) – Any object.

Return type:

bool

Returns:

true if x is an object created from a class which extends Mixin.

Stability:

experimental