# CfnLoggingConfigurationProps

Properties for defining a `CfnLoggingConfiguration`.

Used as props by: [CfnLoggingConfiguration](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_wafv2.CfnLoggingConfiguration.html)

- Source: Generated at build time
- Type last changed: v2.227.0 · 21 Nov 2025

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_wafv2 as wafv2 } from 'aws-cdk-lib';

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 cfnLoggingConfigurationProps: wafv2.CfnLoggingConfigurationProps = {
  logDestinationConfigs: ['logDestinationConfigs'],
  resourceArn: 'resourceArn',

  // the properties below are optional
  loggingFilter: loggingFilter,
  redactedFields: [{
    jsonBody: jsonBody,
    method: method,
    queryString: queryString,
    singleHeader: singleHeader,
    uriPath: uriPath,
  }],
};
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_wafv2 as wafv2

# json_body: Any
# logging_filter: Any
# method: Any
# query_string: Any
# single_header: Any
# uri_path: Any

cfn_logging_configuration_props = wafv2.CfnLoggingConfigurationProps(
    log_destination_configs=["logDestinationConfigs"],
    resource_arn="resourceArn",

    # the properties below are optional
    logging_filter=logging_filter,
    redacted_fields=[wafv2.CfnLoggingConfiguration.FieldToMatchProperty(
        json_body=json_body,
        method=method,
        query_string=query_string,
        single_header=single_header,
        uri_path=uri_path
    )]
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.wafv2.*;

Object jsonBody;
Object loggingFilter;
Object method;
Object queryString;
Object singleHeader;
Object uriPath;

CfnLoggingConfigurationProps cfnLoggingConfigurationProps = CfnLoggingConfigurationProps.builder()
        .logDestinationConfigs(List.of("logDestinationConfigs"))
        .resourceArn("resourceArn")

        // the properties below are optional
        .loggingFilter(loggingFilter)
        .redactedFields(List.of(FieldToMatchProperty.builder()
                .jsonBody(jsonBody)
                .method(method)
                .queryString(queryString)
                .singleHeader(singleHeader)
                .uriPath(uriPath)
                .build()))
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.WAFv2;

var jsonBody;
var loggingFilter;
var method;
var queryString;
var singleHeader;
var uriPath;

var cfnLoggingConfigurationProps = new CfnLoggingConfigurationProps {
    LogDestinationConfigs = new [] { "logDestinationConfigs" },
    ResourceArn = "resourceArn",

    // the properties below are optional
    LoggingFilter = loggingFilter,
    RedactedFields = new [] { new FieldToMatchProperty {
        JsonBody = jsonBody,
        Method = method,
        QueryString = queryString,
        SingleHeader = singleHeader,
        UriPath = uriPath
    } }
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

var jsonBody interface{}
var loggingFilter interface{}
var method interface{}
var queryString interface{}
var singleHeader interface{}
var uriPath interface{}

cfnLoggingConfigurationProps := &CfnLoggingConfigurationProps{
	LogDestinationConfigs: []interface{}{
		jsii.String("logDestinationConfigs"),
	},
	ResourceArn: jsii.String("resourceArn"),

	// the properties below are optional
	LoggingFilter: loggingFilter,
	RedactedFields: []interface{}{
		&FieldToMatchProperty{
			JsonBody: jsonBody,
			Method: method,
			QueryString: queryString,
			SingleHeader: singleHeader,
			UriPath: uriPath,
		},
	},
}
```

## Properties

- `logDestinationConfigs`: string | [IDeliveryStreamRef](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_kinesisfirehose.IDeliveryStreamRef.html) | [ILogGroupRef](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_logs.ILogGroupRef.html) | [IBucketRef](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_s3.IBucketRef.html)[] (required) — The logging destination configuration that you want to associate with the web ACL.

  > You can associate one logging destination to a web ACL.

- `loggingFilter`: any — Filtering that specifies which web requests are kept in the logs and which are dropped.

  You can filter on the rule action and on the web request labels that were applied by matching rules during web ACL evaluation.

- `redactedFields`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnLoggingConfiguration.FieldToMatchProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_wafv2.CfnLoggingConfiguration.FieldToMatchProperty.html)[] — The parts of the request that you want to keep out of the logs.

  For example, if you redact the `SingleHeader` field, the `HEADER` field in the logs will be `REDACTED` for all rules that use the `SingleHeader` `FieldToMatch` setting.

  If you configure data protection for the web ACL, the protection applies to the data that AWS WAF sends to the logs.

  Redaction applies only to the component that's specified in the rule's `FieldToMatch` setting, so the `SingleHeader` redaction doesn't apply to rules that use the `Headers` `FieldToMatch` .

  > You can specify only the following fields for redaction: `UriPath` , `QueryString` , `SingleHeader` , and `Method` . > This setting has no impact on request sampling. You can only exclude fields from request sampling by disabling sampling in the web ACL visibility configuration or by configuring data protection for the web ACL.

- `resourceArn`: string | [IWebACLRef](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_wafv2.IWebACLRef.html) (required) — The Amazon Resource Name (ARN) of the web ACL that you want to associate with `LogDestinationConfigs` .
