Class CfnGuardrail
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.CfnElement
software.amazon.awscdk.CfnRefElement
software.amazon.awscdk.CfnResource
software.amazon.awscdk.services.bedrock.CfnGuardrail
- All Implemented Interfaces:
IInspectable
,ITaggableV2
,software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.98.0 (build 00b106d)",
date="2024-05-24T02:42:34.573Z")
@Stability(Stable)
public class CfnGuardrail
extends CfnResource
implements IInspectable, ITaggableV2
Creates a guardrail to block topics and to implement safeguards for your generative AI applications.
You can configure denied topics to disallow undesirable topics and content filters to block harmful content in model inputs and responses. For more information, see Guardrails for Amazon Bedrock in the Amazon Bedrock User Guide
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import software.amazon.awscdk.services.bedrock.*; CfnGuardrail cfnGuardrail = CfnGuardrail.Builder.create(this, "MyCfnGuardrail") .blockedInputMessaging("blockedInputMessaging") .blockedOutputsMessaging("blockedOutputsMessaging") .name("name") // the properties below are optional .contentPolicyConfig(ContentPolicyConfigProperty.builder() .filtersConfig(List.of(ContentFilterConfigProperty.builder() .inputStrength("inputStrength") .outputStrength("outputStrength") .type("type") .build())) .build()) .description("description") .kmsKeyArn("kmsKeyArn") .sensitiveInformationPolicyConfig(SensitiveInformationPolicyConfigProperty.builder() .piiEntitiesConfig(List.of(PiiEntityConfigProperty.builder() .action("action") .type("type") .build())) .regexesConfig(List.of(RegexConfigProperty.builder() .action("action") .name("name") .pattern("pattern") // the properties below are optional .description("description") .build())) .build()) .tags(List.of(CfnTag.builder() .key("key") .value("value") .build())) .topicPolicyConfig(TopicPolicyConfigProperty.builder() .topicsConfig(List.of(TopicConfigProperty.builder() .definition("definition") .name("name") .type("type") // the properties below are optional .examples(List.of("examples")) .build())) .build()) .wordPolicyConfig(WordPolicyConfigProperty.builder() .managedWordListsConfig(List.of(ManagedWordsConfigProperty.builder() .type("type") .build())) .wordsConfig(List.of(WordConfigProperty.builder() .text("text") .build())) .build()) .build();
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
A fluent builder forCfnGuardrail
.static interface
Content filter config in content policy.static interface
Content policy config for a guardrail.static interface
A managed words config.static interface
Pii entity configuration.static interface
A regex configuration.static interface
Sensitive information policy config for a guardrail.static interface
Topic config in topic policy.static interface
Topic policy config for a guardrail.static interface
A custom word config.static interface
Word policy config for a guardrail.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy
Nested classes/interfaces inherited from interface software.amazon.awscdk.ITaggableV2
ITaggableV2.Jsii$Default, ITaggableV2.Jsii$Proxy
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The CloudFormation resource type name for this resource class. -
Constructor Summary
ModifierConstructorDescriptionprotected
CfnGuardrail
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
CfnGuardrail
(software.amazon.jsii.JsiiObjectRef objRef) CfnGuardrail
(software.constructs.Construct scope, String id, CfnGuardrailProps props) -
Method Summary
Modifier and TypeMethodDescriptionThe date and time at which the guardrail was created.List of failure recommendations.The Amazon Resource Name (ARN) of the guardrail.The unique identifier of the guardrail.Status of the guardrail.List of status reasons.The date and time at which the guardrail was last updated.The version of the guardrail.The message to return when the guardrail blocks a prompt.The message to return when the guardrail blocks a model response.Tag Manager which manages the tags for this resource.Content policy config for a guardrail.A description of the guardrail.The ARN of the AWS KMS key used to encrypt the guardrail.getName()
The name of the guardrail.Sensitive information policy config for a guardrail.getTags()
Metadata that you can assign to a guardrail as key-value pairs.Topic policy config for a guardrail.Word policy config for a guardrail.void
inspect
(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties
(Map<String, Object> props) void
setBlockedInputMessaging
(String value) The message to return when the guardrail blocks a prompt.void
setBlockedOutputsMessaging
(String value) The message to return when the guardrail blocks a model response.void
Content policy config for a guardrail.void
Content policy config for a guardrail.void
setDescription
(String value) A description of the guardrail.void
setKmsKeyArn
(String value) The ARN of the AWS KMS key used to encrypt the guardrail.void
The name of the guardrail.void
Sensitive information policy config for a guardrail.void
Sensitive information policy config for a guardrail.void
Metadata that you can assign to a guardrail as key-value pairs.void
setTopicPolicyConfig
(IResolvable value) Topic policy config for a guardrail.void
Topic policy config for a guardrail.void
setWordPolicyConfig
(IResolvable value) Word policy config for a guardrail.void
Word policy config for a guardrail.Methods inherited from class software.amazon.awscdk.CfnResource
addDeletionOverride, addDependency, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, obtainDependencies, obtainResourceDependencies, removeDependency, replaceDependency, shouldSynthesize, toString, validateProperties
Methods inherited from class software.amazon.awscdk.CfnRefElement
getRef
Methods inherited from class software.amazon.awscdk.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalId
Methods inherited from class software.constructs.Construct
getNode, isConstruct
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
-
-
Constructor Details
-
CfnGuardrail
protected CfnGuardrail(software.amazon.jsii.JsiiObjectRef objRef) -
CfnGuardrail
protected CfnGuardrail(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnGuardrail
@Stability(Stable) public CfnGuardrail(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnGuardrailProps props) - Parameters:
scope
- Scope in which this resource is defined. This parameter is required.id
- Construct identifier for this resource (unique in its scope). This parameter is required.props
- Resource properties. This parameter is required.
-
-
Method Details
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspect
in interfaceIInspectable
- Parameters:
inspector
- tree inspector to collect and process attributes. This parameter is required.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderProperties
in classCfnResource
- Parameters:
props
- This parameter is required.
-
getAttrCreatedAt
The date and time at which the guardrail was created. -
getAttrFailureRecommendations
List of failure recommendations. -
getAttrGuardrailArn
The Amazon Resource Name (ARN) of the guardrail.This a the primary identifier for the guardrail.
-
getAttrGuardrailId
The unique identifier of the guardrail. -
getAttrStatus
Status of the guardrail. -
getAttrStatusReasons
List of status reasons. -
getAttrUpdatedAt
The date and time at which the guardrail was last updated. -
getAttrVersion
The version of the guardrail. -
getCdkTagManager
Tag Manager which manages the tags for this resource.- Specified by:
getCdkTagManager
in interfaceITaggableV2
-
getCfnProperties
- Overrides:
getCfnProperties
in classCfnResource
-
getBlockedInputMessaging
The message to return when the guardrail blocks a prompt. -
setBlockedInputMessaging
The message to return when the guardrail blocks a prompt. -
getBlockedOutputsMessaging
The message to return when the guardrail blocks a model response. -
setBlockedOutputsMessaging
The message to return when the guardrail blocks a model response. -
getName
The name of the guardrail. -
setName
The name of the guardrail. -
getContentPolicyConfig
Content policy config for a guardrail. -
setContentPolicyConfig
Content policy config for a guardrail. -
setContentPolicyConfig
@Stability(Stable) public void setContentPolicyConfig(@Nullable CfnGuardrail.ContentPolicyConfigProperty value) Content policy config for a guardrail. -
getDescription
A description of the guardrail. -
setDescription
A description of the guardrail. -
getKmsKeyArn
The ARN of the AWS KMS key used to encrypt the guardrail. -
setKmsKeyArn
The ARN of the AWS KMS key used to encrypt the guardrail. -
getSensitiveInformationPolicyConfig
Sensitive information policy config for a guardrail. -
setSensitiveInformationPolicyConfig
Sensitive information policy config for a guardrail. -
setSensitiveInformationPolicyConfig
@Stability(Stable) public void setSensitiveInformationPolicyConfig(@Nullable CfnGuardrail.SensitiveInformationPolicyConfigProperty value) Sensitive information policy config for a guardrail. -
getTags
Metadata that you can assign to a guardrail as key-value pairs.For more information, see the following resources:.
-
setTags
Metadata that you can assign to a guardrail as key-value pairs.For more information, see the following resources:.
-
getTopicPolicyConfig
Topic policy config for a guardrail. -
setTopicPolicyConfig
Topic policy config for a guardrail. -
setTopicPolicyConfig
@Stability(Stable) public void setTopicPolicyConfig(@Nullable CfnGuardrail.TopicPolicyConfigProperty value) Topic policy config for a guardrail. -
getWordPolicyConfig
Word policy config for a guardrail. -
setWordPolicyConfig
Word policy config for a guardrail. -
setWordPolicyConfig
@Stability(Stable) public void setWordPolicyConfig(@Nullable CfnGuardrail.WordPolicyConfigProperty value) Word policy config for a guardrail.
-