Class CfnLoggingConfigurationPropsMixin

java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.Mixin
software.amazon.awscdk.cfnpropertymixins.services.wafv2.CfnLoggingConfigurationPropsMixin
All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable, software.constructs.IMixin

@Generated(value="jsii-pacmak/1.127.0 (build 2117ad5)", date="2026-03-11T13:20:06.049Z") @Stability(Stable) public class CfnLoggingConfigurationPropsMixin extends Mixin implements software.constructs.IMixin
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 PutLoggingConfiguration request.

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 software.amazon.awscdk.cfnpropertymixins.services.wafv2.*;
 import software.amazon.awscdk.*;
 Object jsonBody;
 Object loggingFilter;
 IMergeStrategy mergeStrategy;
 Object method;
 Object queryString;
 Object singleHeader;
 Object uriPath;
 CfnLoggingConfigurationPropsMixin cfnLoggingConfigurationPropsMixin = CfnLoggingConfigurationPropsMixin.Builder.create(CfnLoggingConfigurationMixinProps.builder()
         .logDestinationConfigs(List.of("logDestinationConfigs"))
         .loggingFilter(loggingFilter)
         .redactedFields(List.of(FieldToMatchProperty.builder()
                 .jsonBody(jsonBody)
                 .method(method)
                 .queryString(queryString)
                 .singleHeader(singleHeader)
                 .uriPath(uriPath)
                 .build()))
         .resourceArn("resourceArn")
         .build())
 .strategy(mergeStrategy)
 .build();
 

See Also:
  • Field Details

    • CFN_PROPERTY_KEYS

      @Stability(Stable) protected static final List<String> CFN_PROPERTY_KEYS
  • Constructor Details

    • CfnLoggingConfigurationPropsMixin

      protected CfnLoggingConfigurationPropsMixin(software.amazon.jsii.JsiiObjectRef objRef)
    • CfnLoggingConfigurationPropsMixin

      protected CfnLoggingConfigurationPropsMixin(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • CfnLoggingConfigurationPropsMixin

      @Stability(Stable) public CfnLoggingConfigurationPropsMixin(@NotNull CfnLoggingConfigurationMixinProps props, @Nullable CfnPropertyMixinOptions options)
      Create a mixin to apply properties to AWS::WAFv2::LoggingConfiguration.

      Parameters:
      props - L1 properties to apply. This parameter is required.
      options - Mixin options.
    • CfnLoggingConfigurationPropsMixin

      @Stability(Stable) public CfnLoggingConfigurationPropsMixin(@NotNull CfnLoggingConfigurationMixinProps props)
      Create a mixin to apply properties to AWS::WAFv2::LoggingConfiguration.

      Parameters:
      props - L1 properties to apply. This parameter is required.
  • Method Details

    • applyTo

      @Stability(Stable) public void applyTo(@NotNull software.constructs.IConstruct construct)
      Apply the mixin properties to the construct.

      Specified by:
      applyTo in interface software.constructs.IMixin
      Specified by:
      applyTo in class Mixin
      Parameters:
      construct - This parameter is required.
    • supports

      @Stability(Stable) @NotNull public Boolean supports(@NotNull software.constructs.IConstruct construct)
      Check if this mixin supports the given construct.

      Specified by:
      supports in interface software.constructs.IMixin
      Overrides:
      supports in class Mixin
      Parameters:
      construct - This parameter is required.
    • getProps

      @Stability(Stable) @NotNull protected CfnLoggingConfigurationMixinProps getProps()
    • getStrategy

      @Stability(Stable) @NotNull protected IMergeStrategy getStrategy()