RegexFilter
- class aws_cdk.aws_bedrock_alpha.RegexFilter(*, action, name, pattern, description=None, input_action=None, input_enabled=None, output_action=None, output_enabled=None)
Bases:
object(experimental) A Regular expression (regex) filter for sensitive information.
- Parameters:
action (
GuardrailAction) – (experimental) The action to take when a regex match is detected.name (
str) – (experimental) The name of the regex filter.pattern (
str) – (experimental) The regular expression pattern to match.description (
Optional[str]) – (experimental) The description of the regex filter. Default: - No descriptioninput_action (
Optional[GuardrailAction]) – (experimental) The action to take when a regex match is detected in the input. Default: GuardrailAction.BLOCKinput_enabled (
Optional[bool]) – (experimental) Whether the regex filter is enabled for input. Default: trueoutput_action (
Optional[GuardrailAction]) – (experimental) The action to take when a regex match is detected in the output. Default: GuardrailAction.BLOCKoutput_enabled (
Optional[bool]) – (experimental) Whether the regex filter is enabled for output. Default: true
- Stability:
experimental
- ExampleMetadata:
fixture=default infused
Example:
guardrail = bedrock.Guardrail(self, "bedrockGuardrails", guardrail_name="my-BedrockGuardrails" ) # Add regex filter with input/output actions guardrail.add_regex_filter( name="TestRegexFilter", pattern="test-pattern", action=bedrock.GuardrailAction.ANONYMIZE, # below props are optional description="This is a test regex filter", input_action=bedrock.GuardrailAction.BLOCK, input_enabled=True, output_action=bedrock.GuardrailAction.ANONYMIZE, output_enabled=True )
Attributes
- action
(experimental) The action to take when a regex match is detected.
- Stability:
experimental
- description
(experimental) The description of the regex filter.
- Default:
No description
- Stability:
experimental
- input_action
(experimental) The action to take when a regex match is detected in the input.
- Default:
GuardrailAction.BLOCK
- Stability:
experimental
- input_enabled
(experimental) Whether the regex filter is enabled for input.
- Default:
true
- Stability:
experimental
- name
(experimental) The name of the regex filter.
- Stability:
experimental
- output_action
(experimental) The action to take when a regex match is detected in the output.
- Default:
GuardrailAction.BLOCK
- Stability:
experimental
- output_enabled
(experimental) Whether the regex filter is enabled for output.
- Default:
true
- Stability:
experimental
- pattern
(experimental) The regular expression pattern to match.
- Stability:
experimental