Class CfnAgent

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
All Implemented Interfaces:
IInspectable, ITaggableV2, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.104.0 (build e79254c)", date="2024-12-17T21:37:27.095Z") @Stability(Stable) public class CfnAgent extends CfnResource implements IInspectable, ITaggableV2
Specifies an agent as a resource in a top-level template. Minimally, you must specify the following properties:.

For more information about using agents in Amazon Bedrock , see Agents for Amazon Bedrock .

See the Properties section below for descriptions of both the required and optional properties.

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.*;
 CfnAgent cfnAgent = CfnAgent.Builder.create(this, "MyCfnAgent")
         .agentName("agentName")
         // the properties below are optional
         .actionGroups(List.of(AgentActionGroupProperty.builder()
                 .actionGroupName("actionGroupName")
                 // the properties below are optional
                 .actionGroupExecutor(ActionGroupExecutorProperty.builder()
                         .customControl("customControl")
                         .lambda("lambda")
                         .build())
                 .actionGroupState("actionGroupState")
                 .apiSchema(APISchemaProperty.builder()
                         .payload("payload")
                         .s3(S3IdentifierProperty.builder()
                                 .s3BucketName("s3BucketName")
                                 .s3ObjectKey("s3ObjectKey")
                                 .build())
                         .build())
                 .description("description")
                 .functionSchema(FunctionSchemaProperty.builder()
                         .functions(List.of(FunctionProperty.builder()
                                 .name("name")
                                 // the properties below are optional
                                 .description("description")
                                 .parameters(Map.of(
                                         "parametersKey", ParameterDetailProperty.builder()
                                                 .type("type")
                                                 // the properties below are optional
                                                 .description("description")
                                                 .required(false)
                                                 .build()))
                                 .build()))
                         .build())
                 .parentActionGroupSignature("parentActionGroupSignature")
                 .skipResourceInUseCheckOnDelete(false)
                 .build()))
         .agentResourceRoleArn("agentResourceRoleArn")
         .autoPrepare(false)
         .customerEncryptionKeyArn("customerEncryptionKeyArn")
         .description("description")
         .foundationModel("foundationModel")
         .guardrailConfiguration(GuardrailConfigurationProperty.builder()
                 .guardrailIdentifier("guardrailIdentifier")
                 .guardrailVersion("guardrailVersion")
                 .build())
         .idleSessionTtlInSeconds(123)
         .instruction("instruction")
         .knowledgeBases(List.of(AgentKnowledgeBaseProperty.builder()
                 .description("description")
                 .knowledgeBaseId("knowledgeBaseId")
                 // the properties below are optional
                 .knowledgeBaseState("knowledgeBaseState")
                 .build()))
         .promptOverrideConfiguration(PromptOverrideConfigurationProperty.builder()
                 .promptConfigurations(List.of(PromptConfigurationProperty.builder()
                         .basePromptTemplate("basePromptTemplate")
                         .inferenceConfiguration(InferenceConfigurationProperty.builder()
                                 .maximumLength(123)
                                 .stopSequences(List.of("stopSequences"))
                                 .temperature(123)
                                 .topK(123)
                                 .topP(123)
                                 .build())
                         .parserMode("parserMode")
                         .promptCreationMode("promptCreationMode")
                         .promptState("promptState")
                         .promptType("promptType")
                         .build()))
                 // the properties below are optional
                 .overrideLambda("overrideLambda")
                 .build())
         .skipResourceInUseCheckOnDelete(false)
         .tags(Map.of(
                 "tagsKey", "tags"))
         .testAliasTags(Map.of(
                 "testAliasTagsKey", "testAliasTags"))
         .build();
 

See Also:
  • Field Details

    • CFN_RESOURCE_TYPE_NAME

      @Stability(Stable) public static final String CFN_RESOURCE_TYPE_NAME
      The CloudFormation resource type name for this resource class.
  • Constructor Details

    • CfnAgent

      protected CfnAgent(software.amazon.jsii.JsiiObjectRef objRef)
    • CfnAgent

      protected CfnAgent(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • CfnAgent

      @Stability(Stable) public CfnAgent(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnAgentProps 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

      @Stability(Stable) public void inspect(@NotNull TreeInspector inspector)
      Examines the CloudFormation resource and discloses attributes.

      Specified by:
      inspect in interface IInspectable
      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 class CfnResource
      Parameters:
      props - This parameter is required.
    • getAttrAgentArn

      @Stability(Stable) @NotNull public String getAttrAgentArn()
      The Amazon Resource Name (ARN) of the agent.
    • getAttrAgentId

      @Stability(Stable) @NotNull public String getAttrAgentId()
      The unique identifier of the agent.
    • getAttrAgentStatus

      @Stability(Stable) @NotNull public String getAttrAgentStatus()
      The status of the agent and whether it is ready for use. The following statuses are possible:.

      • CREATING – The agent is being created.
      • PREPARING – The agent is being prepared.
      • PREPARED – The agent is prepared and ready to be invoked.
      • NOT_PREPARED – The agent has been created but not yet prepared.
      • FAILED – The agent API operation failed.
      • UPDATING – The agent is being updated.
      • DELETING – The agent is being deleted.
    • getAttrAgentVersion

      @Stability(Stable) @NotNull public String getAttrAgentVersion()
      The version of the agent.
    • getAttrCreatedAt

      @Stability(Stable) @NotNull public String getAttrCreatedAt()
      The time at which the agent was created.
    • getAttrFailureReasons

      @Stability(Stable) @NotNull public List<String> getAttrFailureReasons()
      Contains reasons that the agent-related API that you invoked failed.
    • getAttrPreparedAt

      @Stability(Stable) @NotNull public String getAttrPreparedAt()
      The time at which the agent was last prepared.
    • getAttrRecommendedActions

      @Stability(Stable) @NotNull public List<String> getAttrRecommendedActions()
      Contains recommended actions to take for the agent-related API that you invoked to succeed.
    • getAttrUpdatedAt

      @Stability(Stable) @NotNull public String getAttrUpdatedAt()
      The time at which the agent was last updated.
    • getCdkTagManager

      @Stability(Stable) @NotNull public TagManager getCdkTagManager()
      Tag Manager which manages the tags for this resource.
      Specified by:
      getCdkTagManager in interface ITaggableV2
    • getCfnProperties

      @Stability(Stable) @NotNull protected Map<String,Object> getCfnProperties()
      Overrides:
      getCfnProperties in class CfnResource
    • getAgentName

      @Stability(Stable) @NotNull public String getAgentName()
      The name of the agent.
    • setAgentName

      @Stability(Stable) public void setAgentName(@NotNull String value)
      The name of the agent.
    • getActionGroups

      @Stability(Stable) @Nullable public Object getActionGroups()
      The action groups that belong to an agent.
    • setActionGroups

      @Stability(Stable) public void setActionGroups(@Nullable IResolvable value)
      The action groups that belong to an agent.
    • setActionGroups

      @Stability(Stable) public void setActionGroups(@Nullable List<Object> value)
      The action groups that belong to an agent.
    • getAgentResourceRoleArn

      @Stability(Stable) @Nullable public String getAgentResourceRoleArn()
      The Amazon Resource Name (ARN) of the IAM role with permissions to invoke API operations on the agent.
    • setAgentResourceRoleArn

      @Stability(Stable) public void setAgentResourceRoleArn(@Nullable String value)
      The Amazon Resource Name (ARN) of the IAM role with permissions to invoke API operations on the agent.
    • getAutoPrepare

      @Stability(Stable) @Nullable public Object getAutoPrepare()
      Specifies whether to automatically update the DRAFT version of the agent after making changes to the agent.
    • setAutoPrepare

      @Stability(Stable) public void setAutoPrepare(@Nullable Boolean value)
      Specifies whether to automatically update the DRAFT version of the agent after making changes to the agent.
    • setAutoPrepare

      @Stability(Stable) public void setAutoPrepare(@Nullable IResolvable value)
      Specifies whether to automatically update the DRAFT version of the agent after making changes to the agent.
    • getCustomerEncryptionKeyArn

      @Stability(Stable) @Nullable public String getCustomerEncryptionKeyArn()
      The Amazon Resource Name (ARN) of the AWS KMS key that encrypts the agent.
    • setCustomerEncryptionKeyArn

      @Stability(Stable) public void setCustomerEncryptionKeyArn(@Nullable String value)
      The Amazon Resource Name (ARN) of the AWS KMS key that encrypts the agent.
    • getDescription

      @Stability(Stable) @Nullable public String getDescription()
      The description of the agent.
    • setDescription

      @Stability(Stable) public void setDescription(@Nullable String value)
      The description of the agent.
    • getFoundationModel

      @Stability(Stable) @Nullable public String getFoundationModel()
      The foundation model used for orchestration by the agent.
    • setFoundationModel

      @Stability(Stable) public void setFoundationModel(@Nullable String value)
      The foundation model used for orchestration by the agent.
    • getGuardrailConfiguration

      @Stability(Stable) @Nullable public Object getGuardrailConfiguration()
      Details about the guardrail associated with the agent.
    • setGuardrailConfiguration

      @Stability(Stable) public void setGuardrailConfiguration(@Nullable IResolvable value)
      Details about the guardrail associated with the agent.
    • setGuardrailConfiguration

      @Stability(Stable) public void setGuardrailConfiguration(@Nullable CfnAgent.GuardrailConfigurationProperty value)
      Details about the guardrail associated with the agent.
    • getIdleSessionTtlInSeconds

      @Stability(Stable) @Nullable public Number getIdleSessionTtlInSeconds()
      The number of seconds for which Amazon Bedrock keeps information about a user's conversation with the agent.
    • setIdleSessionTtlInSeconds

      @Stability(Stable) public void setIdleSessionTtlInSeconds(@Nullable Number value)
      The number of seconds for which Amazon Bedrock keeps information about a user's conversation with the agent.
    • getInstruction

      @Stability(Stable) @Nullable public String getInstruction()
      Instructions that tell the agent what it should do and how it should interact with users.
    • setInstruction

      @Stability(Stable) public void setInstruction(@Nullable String value)
      Instructions that tell the agent what it should do and how it should interact with users.
    • getKnowledgeBases

      @Stability(Stable) @Nullable public Object getKnowledgeBases()
      The knowledge bases associated with the agent.
    • setKnowledgeBases

      @Stability(Stable) public void setKnowledgeBases(@Nullable IResolvable value)
      The knowledge bases associated with the agent.
    • setKnowledgeBases

      @Stability(Stable) public void setKnowledgeBases(@Nullable List<Object> value)
      The knowledge bases associated with the agent.
    • getPromptOverrideConfiguration

      @Stability(Stable) @Nullable public Object getPromptOverrideConfiguration()
      Contains configurations to override prompt templates in different parts of an agent sequence.
    • setPromptOverrideConfiguration

      @Stability(Stable) public void setPromptOverrideConfiguration(@Nullable IResolvable value)
      Contains configurations to override prompt templates in different parts of an agent sequence.
    • setPromptOverrideConfiguration

      @Stability(Stable) public void setPromptOverrideConfiguration(@Nullable CfnAgent.PromptOverrideConfigurationProperty value)
      Contains configurations to override prompt templates in different parts of an agent sequence.
    • getSkipResourceInUseCheckOnDelete

      @Stability(Stable) @Nullable public Object getSkipResourceInUseCheckOnDelete()
      Specifies whether to delete the resource even if it's in use.
    • setSkipResourceInUseCheckOnDelete

      @Stability(Stable) public void setSkipResourceInUseCheckOnDelete(@Nullable Boolean value)
      Specifies whether to delete the resource even if it's in use.
    • setSkipResourceInUseCheckOnDelete

      @Stability(Stable) public void setSkipResourceInUseCheckOnDelete(@Nullable IResolvable value)
      Specifies whether to delete the resource even if it's in use.
    • getTags

      @Stability(Stable) @Nullable public Map<String,String> getTags()
      Metadata that you can assign to a resource as key-value pairs.

      For more information, see the following resources:.

    • setTags

      @Stability(Stable) public void setTags(@Nullable Map<String,String> value)
      Metadata that you can assign to a resource as key-value pairs.

      For more information, see the following resources:.

    • getTestAliasTags

      @Stability(Stable) @Nullable public Object getTestAliasTags()
      Metadata that you can assign to a resource as key-value pairs.

      For more information, see the following resources:.

    • setTestAliasTags

      @Stability(Stable) public void setTestAliasTags(@Nullable IResolvable value)
      Metadata that you can assign to a resource as key-value pairs.

      For more information, see the following resources:.

    • setTestAliasTags

      @Stability(Stable) public void setTestAliasTags(@Nullable Map<String,String> value)
      Metadata that you can assign to a resource as key-value pairs.

      For more information, see the following resources:.