class CfnLoggingConfigurationPropsMixin
| Language | Type name |
|---|---|
.NET | Amazon.CDK.Mixins.Preview.AWS.WAFv2.Mixins.CfnLoggingConfigurationPropsMixin |
Go | github.com/aws/aws-cdk-go/awscdkmixinspreview/v2/awswafv2/mixins#CfnLoggingConfigurationPropsMixin |
Java | software.amazon.awscdk.mixins.preview.services.wafv2.mixins.CfnLoggingConfigurationPropsMixin |
Python | aws_cdk.mixins_preview.aws_wafv2.mixins.CfnLoggingConfigurationPropsMixin |
TypeScript | @aws-cdk/mixins-preview » aws_wafv2 » mixins » CfnLoggingConfigurationPropsMixin |
Implements
IMixin
Extends
Mixin
Defines an association between logging destinations and a web ACL resource, for logging from AWS WAF .
As part of the association, you can specify parts of the standard logging fields to keep out of the logs and you can specify filters so that you log only a subset of the logging records.
If you configure data protection for the web ACL, the protection applies to the data that AWS WAF sends to the logs.
You can define one logging destination per web ACL.
You can access information about the traffic that AWS WAF inspects using the following steps:
- Create your logging destination. You can use an Amazon CloudWatch Logs log group, an Amazon Simple Storage Service (Amazon S3) bucket, or an Amazon Kinesis Data Firehose.
The name that you give the destination must start with aws-waf-logs- . Depending on the type of destination, you might need to configure additional settings or permissions.
For configuration requirements and pricing information for each destination type, see Logging web ACL traffic in the AWS WAF Developer Guide .
- Associate your logging destination to your web ACL using a
PutLoggingConfigurationrequest.
When you successfully enable logging using a PutLoggingConfiguration request, AWS WAF creates an additional role or policy that is required to write logs to the logging destination. For an Amazon CloudWatch Logs log group, AWS WAF creates a resource policy on the log group. For an Amazon S3 bucket, AWS WAF creates a bucket policy. For an Amazon Kinesis Data Firehose, AWS WAF creates a service-linked role.
For additional information about web ACL logging, see Logging web ACL traffic information in the AWS WAF Developer Guide .
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { mixins } from '@aws-cdk/mixins-preview';
import { mixins as wafv2_mixins } from '@aws-cdk/mixins-preview/aws-wafv2';
declare const jsonBody: any;
declare const loggingFilter: any;
declare const method: any;
declare const queryString: any;
declare const singleHeader: any;
declare const uriPath: any;
const cfnLoggingConfigurationPropsMixin = new wafv2_mixins.CfnLoggingConfigurationPropsMixin({
logDestinationConfigs: ['logDestinationConfigs'],
loggingFilter: loggingFilter,
redactedFields: [{
jsonBody: jsonBody,
method: method,
queryString: queryString,
singleHeader: singleHeader,
uriPath: uriPath,
}],
resourceArn: 'resourceArn',
}, /* all optional props */ {
strategy: mixins.PropertyMergeStrategy.OVERRIDE,
});
Initializer
new CfnLoggingConfigurationPropsMixin(props: CfnLoggingConfigurationMixinProps, options?: CfnPropertyMixinOptions)
Parameters
- props
Cfn— L1 properties to apply.Logging Configuration Mixin Props - options
Cfn— Mixin options.Property Mixin Options
Create a mixin to apply properties to AWS::WAFv2::LoggingConfiguration.
Properties
| Name | Type | Description |
|---|---|---|
| props | Cfn | |
| strategy | Property | |
| static CFN_PROPERTY_KEYS | string[] |
props
Type:
Cfn
strategy
Type:
Property
static CFN_PROPERTY_KEYS
Type:
string[]
Methods
| Name | Description |
|---|---|
| apply | Apply the mixin properties to the construct. |
| supports(construct) | Check if this mixin supports the given construct. |
applyTo(construct)
public applyTo(construct: IConstruct): IConstruct
Parameters
- construct
IConstruct
Returns
Apply the mixin properties to the construct.
supports(construct)
public supports(construct: IConstruct): boolean
Parameters
- construct
IConstruct
Returns
boolean
Check if this mixin supports the given construct.

.NET
Go
Java
Python
TypeScript