# DataProtectProperty

- 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 dataProtectProperty: wafv2.CfnWebACL.DataProtectProperty = {
  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_protect_property = 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.*;

DataProtectProperty dataProtectProperty = 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();
```

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 dataProtectProperty = 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"

dataProtectProperty := &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

- `action`: string (required)

- `excludeRateBasedDetails`: boolean | [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html)

- `excludeRuleMatchDetails`: boolean | [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html)

- `field`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnWebACL.FieldToProtectProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_wafv2.CfnWebACL.FieldToProtectProperty.html) (required) — Field in log to protect.
