# DataProtectionConfigProperty

Specifies data protection to apply to the web request data for the web ACL.

This is a web ACL level data protection option.

The data protection that you configure for the web ACL alters the data that's available for any other data collection activity, including your AWS WAF logging destinations, web ACL request sampling, and Amazon Security Lake data collection and management. Your other option for data protection is in the logging configuration, which only affects logging.

This is part of the data protection configuration for a web ACL.

- Source: Generated at build time
- Type last changed: v2.186.0 · 27 Mar 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';
const dataProtectionConfigProperty: wafv2.CfnWebACL.DataProtectionConfigProperty = {
  dataProtections: [{
    action: 'action',
    field: {
      fieldType: 'fieldType',

      // the properties below are optional
      fieldKeys: ['fieldKeys'],
    },

    // the properties below are optional
    excludeRateBasedDetails: false,
    excludeRuleMatchDetails: false,
  }],
};
```

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

data_protection_config_property = wafv2.CfnWebACL.DataProtectionConfigProperty(
    data_protections=[wafv2.CfnWebACL.DataProtectProperty(
        action="action",
        field=wafv2.CfnWebACL.FieldToProtectProperty(
            field_type="fieldType",

            # the properties below are optional
            field_keys=["fieldKeys"]
        ),

        # the properties below are optional
        exclude_rate_based_details=False,
        exclude_rule_match_details=False
    )]
)
```

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.*;

DataProtectionConfigProperty dataProtectionConfigProperty = DataProtectionConfigProperty.builder()
        .dataProtections(List.of(DataProtectProperty.builder()
                .action("action")
                .field(FieldToProtectProperty.builder()
                        .fieldType("fieldType")

                        // the properties below are optional
                        .fieldKeys(List.of("fieldKeys"))
                        .build())

                // the properties below are optional
                .excludeRateBasedDetails(false)
                .excludeRuleMatchDetails(false)
                .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 dataProtectionConfigProperty = new DataProtectionConfigProperty {
    DataProtections = new [] { new DataProtectProperty {
        Action = "action",
        Field = new FieldToProtectProperty {
            FieldType = "fieldType",

            // the properties below are optional
            FieldKeys = new [] { "fieldKeys" }
        },

        // the properties below are optional
        ExcludeRateBasedDetails = false,
        ExcludeRuleMatchDetails = false
    } }
};
```

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"

dataProtectionConfigProperty := &DataProtectionConfigProperty{
	DataProtections: []interface{}{
		&DataProtectProperty{
			Action: jsii.String("action"),
			Field: &FieldToProtectProperty{
				FieldType: jsii.String("fieldType"),

				// the properties below are optional
				FieldKeys: []*string{
					jsii.String("fieldKeys"),
				},
			},

			// the properties below are optional
			ExcludeRateBasedDetails: jsii.Boolean(false),
			ExcludeRuleMatchDetails: jsii.Boolean(false),
		},
	},
}
```

## Properties

- `dataProtections`: [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) | [CfnWebACL.DataProtectProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_wafv2.CfnWebACL.DataProtectProperty.html)[] (required) — An array of data protection configurations for specific web request field types.

  This is defined for each web ACL. AWS WAF applies the specified protection to all web requests that the web ACL inspects.
