CfnEnforcedGuardrailConfigurationPropsMixin

class aws_cdk.cfn_property_mixins.aws_bedrock.CfnEnforcedGuardrailConfigurationPropsMixin(props, *, strategy=None)

Bases: Mixin

Definition of AWS::Bedrock::EnforcedGuardrailConfiguration Resource Type.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-bedrock-enforcedguardrailconfiguration.html

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:

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 x is a Mixin.

Parameters:

x (Any) – Any object.

Return type:

bool

Returns:

true if x is an object created from a class which extends Mixin.

ModelEnforcementProperty

class CfnEnforcedGuardrailConfigurationPropsMixin.ModelEnforcementProperty(*, excluded_models=None, included_models=None)

Bases: object

Model-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 excluded

  • included_models (Optional[Sequence[str]]) – Models to enforce the guardrail on.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-bedrock-enforcedguardrailconfiguration-modelenforcement.html

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

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-bedrock-enforcedguardrailconfiguration-modelenforcement.html#cfn-bedrock-enforcedguardrailconfiguration-modelenforcement-excludedmodels

included_models

Models to enforce the guardrail on.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-bedrock-enforcedguardrailconfiguration-modelenforcement.html#cfn-bedrock-enforcedguardrailconfiguration-modelenforcement-includedmodels

SelectiveContentGuardingProperty

class CfnEnforcedGuardrailConfigurationPropsMixin.SelectiveContentGuardingProperty(*, messages=None, system=None)

Bases: object

Selective 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:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-bedrock-enforcedguardrailconfiguration-selectivecontentguarding.html

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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-bedrock-enforcedguardrailconfiguration-selectivecontentguarding.html#cfn-bedrock-enforcedguardrailconfiguration-selectivecontentguarding-messages

system

Selective guarding mode for system prompts.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-bedrock-enforcedguardrailconfiguration-selectivecontentguarding.html#cfn-bedrock-enforcedguardrailconfiguration-selectivecontentguarding-system