# CustomPatternProperty

The pattern configuration for redacting custom data types in session.

- Source: Generated at build time
- Type last changed: v2.172.0 · 7 Dec 2024

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_workspacesweb as workspacesweb } from 'aws-cdk-lib';
const customPatternProperty: workspacesweb.CfnDataProtectionSettings.CustomPatternProperty = {
  patternName: 'patternName',
  patternRegex: 'patternRegex',

  // the properties below are optional
  keywordRegex: 'keywordRegex',
  patternDescription: 'patternDescription',
};
```

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_workspacesweb as workspacesweb

custom_pattern_property = workspacesweb.CfnDataProtectionSettings.CustomPatternProperty(
    pattern_name="patternName",
    pattern_regex="patternRegex",

    # the properties below are optional
    keyword_regex="keywordRegex",
    pattern_description="patternDescription"
)
```

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

CustomPatternProperty customPatternProperty = CustomPatternProperty.builder()
        .patternName("patternName")
        .patternRegex("patternRegex")

        // the properties below are optional
        .keywordRegex("keywordRegex")
        .patternDescription("patternDescription")
        .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.WorkSpacesWeb;

var customPatternProperty = new CustomPatternProperty {
    PatternName = "patternName",
    PatternRegex = "patternRegex",

    // the properties below are optional
    KeywordRegex = "keywordRegex",
    PatternDescription = "patternDescription"
};
```

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"

customPatternProperty := &CustomPatternProperty{
	PatternName: jsii.String("patternName"),
	PatternRegex: jsii.String("patternRegex"),

	// the properties below are optional
	KeywordRegex: jsii.String("keywordRegex"),
	PatternDescription: jsii.String("patternDescription"),
}
```

## Properties

- `keywordRegex`: string — The keyword regex for the customer pattern.

  After there is a match to the pattern regex, the keyword regex is used to search within the proximity of the match. If there is a keyword match, then the match is confirmed. If no keyword regex is provided, the pattern regex match will automatically be confirmed. The format must follow JavaScript regex format. The pattern must be enclosed between slashes, and can have flags behind the second slash. For example, “/ab+c/gi”

- `patternDescription`: string — The pattern description for the customer pattern.

- `patternName`: string (required) — The pattern name for the custom pattern.

- `patternRegex`: string (required) — The pattern regex for the customer pattern.

  The format must follow JavaScript regex format. The pattern must be enclosed between slashes, and can have flags behind the second slash. For example: “/ab+c/gi”.
