interface RegexFilter
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.Bedrock.Alpha.RegexFilter |
Go | github.com/aws/aws-cdk-go/awsbedrockalpha/v2#RegexFilter |
Java | software.amazon.awscdk.services.bedrock.alpha.RegexFilter |
Python | aws_cdk.aws_bedrock_alpha.RegexFilter |
TypeScript (source) | @aws-cdk/aws-bedrock-alpha ยป RegexFilter |
A Regular expression (regex) filter for sensitive information.
Example
const guardrail = new bedrock.Guardrail(this, 'bedrockGuardrails', {
guardrailName: 'my-BedrockGuardrails',
});
// Add regex filter with input/output actions
guardrail.addRegexFilter({
name: 'TestRegexFilter',
pattern: 'test-pattern',
action: bedrock.GuardrailAction.ANONYMIZE,
// below props are optional
description: 'This is a test regex filter',
inputAction: bedrock.GuardrailAction.BLOCK,
inputEnabled: true,
outputAction: bedrock.GuardrailAction.ANONYMIZE,
outputEnabled: true,
});
Properties
| Name | Type | Description |
|---|---|---|
| action | Guardrail | The action to take when a regex match is detected. |
| name | string | The name of the regex filter. |
| pattern | string | The regular expression pattern to match. |
| description? | string | The description of the regex filter. |
| input | Guardrail | The action to take when a regex match is detected in the input. |
| input | boolean | Whether the regex filter is enabled for input. |
| output | Guardrail | The action to take when a regex match is detected in the output. |
| output | boolean | Whether the regex filter is enabled for output. |
action
Type:
Guardrail
The action to take when a regex match is detected.
name
Type:
string
The name of the regex filter.
pattern
Type:
string
The regular expression pattern to match.
description?
Type:
string
(optional, default: No description)
The description of the regex filter.
inputAction?
Type:
Guardrail
(optional, default: GuardrailAction.BLOCK)
The action to take when a regex match is detected in the input.
inputEnabled?
Type:
boolean
(optional, default: true)
Whether the regex filter is enabled for input.
outputAction?
Type:
Guardrail
(optional, default: GuardrailAction.BLOCK)
The action to take when a regex match is detected in the output.
outputEnabled?
Type:
boolean
(optional, default: true)
Whether the regex filter is enabled for output.

.NET
Go
Java
Python
TypeScript (