CfnEnforcedGuardrailConfigurationPropsMixin
- class aws_cdk.cfn_property_mixins.aws_bedrock.CfnEnforcedGuardrailConfigurationPropsMixin(props, *, strategy=None)
Bases:
MixinDefinition of AWS::Bedrock::EnforcedGuardrailConfiguration Resource Type.
- See:
- CloudformationResource:
AWS::Bedrock::EnforcedGuardrailConfiguration
- Mixin:
true
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.cfn_property_mixins import aws_bedrock as bedrock import aws_cdk as cdk # merge_strategy: cdk.IMergeStrategy cfn_enforced_guardrail_configuration_props_mixin = bedrock.CfnEnforcedGuardrailConfigurationPropsMixin(bedrock.CfnEnforcedGuardrailConfigurationMixinProps( guardrail_identifier="guardrailIdentifier", guardrail_version="guardrailVersion", model_enforcement=bedrock.CfnEnforcedGuardrailConfigurationPropsMixin.ModelEnforcementProperty( excluded_models=["excludedModels"], included_models=["includedModels"] ), selective_content_guarding=bedrock.CfnEnforcedGuardrailConfigurationPropsMixin.SelectiveContentGuardingProperty( messages="messages", system="system" ) ), strategy=merge_strategy )
Create a mixin to apply properties to
AWS::Bedrock::EnforcedGuardrailConfiguration.- Parameters:
props (
Union[CfnEnforcedGuardrailConfigurationMixinProps,Dict[str,Any]]) – L1 properties to apply.strategy (
Optional[IMergeStrategy]) – Strategy for merging nested properties. Default: - PropertyMergeStrategy.combine()
Methods
- apply_to(construct)
Apply the mixin properties to the construct.
- Parameters:
construct (
IConstruct)- Return type:
None
- supports(construct)
Check if this mixin supports the given construct.
- Parameters:
construct (
IConstruct)- Return type:
bool
Attributes
- CFN_PROPERTY_KEYS = ['guardrailIdentifier', 'guardrailVersion', 'modelEnforcement', 'selectiveContentGuarding']
Static Methods
- classmethod is_mixin(x)
Checks if
xis a Mixin.- Parameters:
x (
Any) – Any object.- Return type:
bool- Returns:
true if
xis an object created from a class which extendsMixin.
ModelEnforcementProperty
- class CfnEnforcedGuardrailConfigurationPropsMixin.ModelEnforcementProperty(*, excluded_models=None, included_models=None)
Bases:
objectModel-specific information for the enforced guardrail configuration.
If not present, the configuration is enforced on all models
- Parameters:
excluded_models (
Optional[Sequence[str]]) – Models to exclude from enforcement. If a model is in both lists, it is excludedincluded_models (
Optional[Sequence[str]]) – Models to enforce the guardrail on.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.cfn_property_mixins import aws_bedrock as bedrock model_enforcement_property = bedrock.CfnEnforcedGuardrailConfigurationPropsMixin.ModelEnforcementProperty( excluded_models=["excludedModels"], included_models=["includedModels"] )
Attributes
- excluded_models
Models to exclude from enforcement.
If a model is in both lists, it is excluded
- included_models
Models to enforce the guardrail on.
SelectiveContentGuardingProperty
- class CfnEnforcedGuardrailConfigurationPropsMixin.SelectiveContentGuardingProperty(*, messages=None, system=None)
Bases:
objectSelective content guarding controls for enforced guardrails.
- Parameters:
messages (
Optional[str]) – Selective guarding mode for user messages.system (
Optional[str]) – Selective guarding mode for system prompts.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.cfn_property_mixins import aws_bedrock as bedrock selective_content_guarding_property = bedrock.CfnEnforcedGuardrailConfigurationPropsMixin.SelectiveContentGuardingProperty( messages="messages", system="system" )
Attributes
- messages
Selective guarding mode for user messages.
- system
Selective guarding mode for system prompts.