class CfnDistributionLogsMixin
| Language | Type name |
|---|---|
.NET | Amazon.CDK.Mixins.Preview.AWS.CloudFront.Mixins.CfnDistributionLogsMixin |
Go | github.com/aws/aws-cdk-go/awscdkmixinspreview/v2/awscloudfront/mixins#CfnDistributionLogsMixin |
Java | software.amazon.awscdk.mixins.preview.services.cloudfront.mixins.CfnDistributionLogsMixin |
Python | aws_cdk.mixins_preview.aws_cloudfront.mixins.CfnDistributionLogsMixin |
TypeScript | @aws-cdk/mixins-preview » aws_cloudfront » mixins » CfnDistributionLogsMixin |
Implements
IMixin
Extends
Mixin
A distribution tells CloudFront where you want content to be delivered from, and the details about how to track and manage content delivery.
Example
import '@aws-cdk/mixins-preview/with';
import * as cloudfrontMixins from '@aws-cdk/mixins-preview/aws-cloudfront/mixins';
// Create CloudFront distribution
declare const origin: s3.IBucket;
const distribution = new cloudfront.Distribution(scope, 'Distribution', {
defaultBehavior: {
origin: origins.S3BucketOrigin.withOriginAccessControl(origin),
},
});
// Create destination bucket
const destBucket = new s3.Bucket(scope, 'DeliveryBucket');
// Add permissions to bucket to facilitate log delivery
const bucketPolicy = new s3.BucketPolicy(scope, 'DeliveryBucketPolicy', {
bucket: destBucket,
document: new iam.PolicyDocument(),
});
// Create S3 delivery destination for logs
const destination = new logs.CfnDeliveryDestination(scope, 'Destination', {
destinationResourceArn: destBucket.bucketArn,
name: 'unique-destination-name',
deliveryDestinationType: 'S3',
});
distribution
.with(cloudfrontMixins.CfnDistributionLogsMixin.CONNECTION_LOGS.toDestination(destination));
Initializer
new CfnDistributionLogsMixin(logType: string, logDelivery: ILogsDelivery)
Parameters
- logType
string— Type of logs that are getting vended. - logDelivery
ILogs— Object in charge of setting up the delivery source, delivery destination, and delivery connection.Delivery
Create a mixin to enable vended logs for AWS::CloudFront::Distribution.
Properties
| Name | Type | Description |
|---|---|---|
| log | ILogs | |
| log | string | |
| static ACCESS_LOGS | Cfn | |
| static CONNECTION_LOGS | Cfn |
logDelivery
Type:
ILogs
logType
Type:
string
static ACCESS_LOGS
Type:
Cfn
static CONNECTION_LOGS
Type:
Cfn
Methods
| Name | Description |
|---|---|
| apply | Apply vended logs configuration to the construct. |
| supports(construct) | Check if this mixin supports the given construct (has vendedLogs property). |
applyTo(resource)
public applyTo(resource: IConstruct): void
Parameters
- resource
IConstruct
Apply vended logs configuration to the construct.
supports(construct)
public supports(construct: IConstruct): boolean
Parameters
- construct
IConstruct
Returns
boolean
Check if this mixin supports the given construct (has vendedLogs property).

.NET
Go
Java
Python
TypeScript