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

@Generated(value="jsii-pacmak/1.133.0 (build 0f43e37)", date="2026-06-08T20:22:39.845Z") @Stability(Stable) public class CfnHarness extends CfnResource implements IInspectable, IHarnessRef, ITaggableV2
Definition of AWS::BedrockAgentCore::Harness resource type - a managed agentic loop service that provides a turnkey solution for running stateful, tool-equipped AI agents.

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.bedrockagentcore.*;
 Object awsIam;
 Object inputSchema;
 Object none;
 CfnHarness cfnHarness = CfnHarness.Builder.create(this, "MyCfnHarness")
         .executionRoleArn("executionRoleArn")
         .harnessName("harnessName")
         .model(HarnessModelConfigurationProperty.builder()
                 .bedrockModelConfig(HarnessBedrockModelConfigProperty.builder()
                         .modelId("modelId")
                         // the properties below are optional
                         .maxTokens(123)
                         .temperature(123)
                         .topP(123)
                         .build())
                 .geminiModelConfig(HarnessGeminiModelConfigProperty.builder()
                         .apiKeyArn("apiKeyArn")
                         .modelId("modelId")
                         // the properties below are optional
                         .maxTokens(123)
                         .temperature(123)
                         .topK(123)
                         .topP(123)
                         .build())
                 .openAiModelConfig(HarnessOpenAiModelConfigProperty.builder()
                         .apiKeyArn("apiKeyArn")
                         .modelId("modelId")
                         // the properties below are optional
                         .maxTokens(123)
                         .temperature(123)
                         .topP(123)
                         .build())
                 .build())
         // the properties below are optional
         .allowedTools(List.of("allowedTools"))
         .authorizerConfiguration(AuthorizerConfigurationProperty.builder()
                 .customJwtAuthorizer(CustomJWTAuthorizerConfigurationProperty.builder()
                         .discoveryUrl("discoveryUrl")
                         // the properties below are optional
                         .allowedAudience(List.of("allowedAudience"))
                         .allowedClients(List.of("allowedClients"))
                         .allowedScopes(List.of("allowedScopes"))
                         .customClaims(List.of(CustomClaimValidationTypeProperty.builder()
                                 .authorizingClaimMatchValue(AuthorizingClaimMatchValueTypeProperty.builder()
                                         .claimMatchOperator("claimMatchOperator")
                                         .claimMatchValue(ClaimMatchValueTypeProperty.builder()
                                                 .matchValueString("matchValueString")
                                                 .matchValueStringList(List.of("matchValueStringList"))
                                                 .build())
                                         .build())
                                 .inboundTokenClaimName("inboundTokenClaimName")
                                 .inboundTokenClaimValueType("inboundTokenClaimValueType")
                                 .build()))
                         .build())
                 .build())
         .environment(HarnessEnvironmentProviderProperty.builder()
                 .agentCoreRuntimeEnvironment(HarnessAgentCoreRuntimeEnvironmentProperty.builder()
                         .agentRuntimeArn("agentRuntimeArn")
                         .agentRuntimeId("agentRuntimeId")
                         .agentRuntimeName("agentRuntimeName")
                         .filesystemConfigurations(List.of(FilesystemConfigurationProperty.builder()
                                 .sessionStorage(SessionStorageConfigurationProperty.builder()
                                         .mountPath("mountPath")
                                         .build())
                                 .build()))
                         .lifecycleConfiguration(LifecycleConfigurationProperty.builder()
                                 .idleRuntimeSessionTimeout(123)
                                 .maxLifetime(123)
                                 .build())
                         .networkConfiguration(NetworkConfigurationProperty.builder()
                                 .networkMode("networkMode")
                                 // the properties below are optional
                                 .networkModeConfig(VpcConfigProperty.builder()
                                         .securityGroups(List.of("securityGroups"))
                                         .subnets(List.of("subnets"))
                                         .build())
                                 .build())
                         .build())
                 .build())
         .environmentArtifact(HarnessEnvironmentArtifactProperty.builder()
                 .containerConfiguration(ContainerConfigurationProperty.builder()
                         .containerUri("containerUri")
                         .build())
                 .build())
         .environmentVariables(Map.of(
                 "environmentVariablesKey", "environmentVariables"))
         .maxIterations(123)
         .maxTokens(123)
         .memory(HarnessMemoryConfigurationProperty.builder()
                 .agentCoreMemoryConfiguration(HarnessAgentCoreMemoryConfigurationProperty.builder()
                         .arn("arn")
                         // the properties below are optional
                         .actorId("actorId")
                         .messagesCount(123)
                         .retrievalConfig(Map.of(
                                 "retrievalConfigKey", HarnessAgentCoreMemoryRetrievalConfigProperty.builder()
                                         .relevanceScore(123)
                                         .strategyId("strategyId")
                                         .topK(123)
                                         .build()))
                         .build())
                 .build())
         .skills(List.of(HarnessSkillProperty.builder()
                 .path("path")
                 .build()))
         .systemPrompt(List.of(HarnessSystemContentBlockProperty.builder()
                 .text("text")
                 .build()))
         .tags(List.of(CfnTag.builder()
                 .key("key")
                 .value("value")
                 .build()))
         .timeoutSeconds(123)
         .tools(List.of(HarnessToolProperty.builder()
                 .type("type")
                 // the properties below are optional
                 .config(HarnessToolConfigurationProperty.builder()
                         .agentCoreBrowser(HarnessAgentCoreBrowserConfigProperty.builder()
                                 .browserArn("browserArn")
                                 .build())
                         .agentCoreCodeInterpreter(HarnessAgentCoreCodeInterpreterConfigProperty.builder()
                                 .codeInterpreterArn("codeInterpreterArn")
                                 .build())
                         .agentCoreGateway(HarnessAgentCoreGatewayConfigProperty.builder()
                                 .gatewayArn("gatewayArn")
                                 // the properties below are optional
                                 .outboundAuth(HarnessGatewayOutboundAuthProperty.builder()
                                         .awsIam(awsIam)
                                         .none(none)
                                         .oauth(OAuthCredentialProviderProperty.builder()
                                                 .providerArn("providerArn")
                                                 .scopes(List.of("scopes"))
                                                 // the properties below are optional
                                                 .customParameters(Map.of(
                                                         "customParametersKey", "customParameters"))
                                                 .defaultReturnUrl("defaultReturnUrl")
                                                 .grantType("grantType")
                                                 .build())
                                         .build())
                                 .build())
                         .inlineFunction(HarnessInlineFunctionConfigProperty.builder()
                                 .description("description")
                                 .inputSchema(inputSchema)
                                 .build())
                         .remoteMcp(HarnessRemoteMcpConfigProperty.builder()
                                 .url("url")
                                 // the properties below are optional
                                 .headers(Map.of(
                                         "headersKey", "headers"))
                                 .build())
                         .build())
                 .name("name")
                 .build()))
         .truncation(HarnessTruncationConfigurationProperty.builder()
                 .strategy("strategy")
                 // the properties below are optional
                 .config(HarnessTruncationStrategyConfigurationProperty.builder()
                         .slidingWindow(HarnessSlidingWindowConfigurationProperty.builder()
                                 .messagesCount(123)
                                 .build())
                         .summarization(HarnessSummarizationConfigurationProperty.builder()
                                 .preserveRecentMessages(123)
                                 .summarizationSystemPrompt("summarizationSystemPrompt")
                                 .summaryRatio(123)
                                 .build())
                         .build())
                 .build())
         .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

    • CfnHarness

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

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

      @Stability(Stable) public CfnHarness(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnHarnessProps props)
      Create a new AWS::BedrockAgentCore::Harness.

      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

    • arnForHarness

      @Stability(Stable) @NotNull public static String arnForHarness(@NotNull IHarnessRef resource)
      Parameters:
      resource - This parameter is required.
    • isCfnHarness

      @Stability(Stable) @NotNull public static Boolean isCfnHarness(@NotNull Object x)
      Checks whether the given object is a CfnHarness.

      Parameters:
      x - This parameter is required.
    • 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.
    • getAttrArn

      @Stability(Stable) @NotNull public String getAttrArn()
      The Amazon Resource Name (ARN) of the harness.
    • getAttrCreatedAt

      @Stability(Stable) @NotNull public String getAttrCreatedAt()
      The timestamp when the harness was created.
    • getAttrEnvironmentAgentCoreRuntimeEnvironmentAgentRuntimeArn

      @Stability(Stable) @NotNull public String getAttrEnvironmentAgentCoreRuntimeEnvironmentAgentRuntimeArn()
      The ARN of the underlying AgentCore Runtime.
    • getAttrEnvironmentAgentCoreRuntimeEnvironmentAgentRuntimeId

      @Stability(Stable) @NotNull public String getAttrEnvironmentAgentCoreRuntimeEnvironmentAgentRuntimeId()
      The ID of the underlying AgentCore Runtime.
    • getAttrEnvironmentAgentCoreRuntimeEnvironmentAgentRuntimeName

      @Stability(Stable) @NotNull public String getAttrEnvironmentAgentCoreRuntimeEnvironmentAgentRuntimeName()
      The name of the underlying AgentCore Runtime.
    • getAttrHarnessId

      @Stability(Stable) @NotNull public String getAttrHarnessId()
      The unique identifier of the harness.
    • getAttrStatus

      @Stability(Stable) @NotNull public String getAttrStatus()
    • getAttrUpdatedAt

      @Stability(Stable) @NotNull public String getAttrUpdatedAt()
      The timestamp when the harness 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
    • getCfnPropertyNames

      @Stability(Stable) @NotNull protected Map<String,String> getCfnPropertyNames()
      Overrides:
      getCfnPropertyNames in class CfnResource
    • getHarnessRef

      @Stability(Stable) @NotNull public HarnessReference getHarnessRef()
      A reference to a Harness resource.
      Specified by:
      getHarnessRef in interface IHarnessRef
    • getExecutionRoleArn

      @Stability(Stable) @NotNull public String getExecutionRoleArn()
      The ARN of the IAM role that the harness assumes when running.
    • setExecutionRoleArn

      @Stability(Stable) public void setExecutionRoleArn(@NotNull String value)
      The ARN of the IAM role that the harness assumes when running.
    • getHarnessName

      @Stability(Stable) @NotNull public String getHarnessName()
      The name of the harness.
    • setHarnessName

      @Stability(Stable) public void setHarnessName(@NotNull String value)
      The name of the harness.
    • getModel

      @Stability(Stable) @NotNull public Object getModel()
    • setModel

      @Stability(Stable) public void setModel(@NotNull IResolvable value)
    • setModel

      @Stability(Stable) public void setModel(@NotNull CfnHarness.HarnessModelConfigurationProperty value)
    • getAllowedTools

      @Stability(Stable) @Nullable public List<String> getAllowedTools()
      The tools that the agent is allowed to use.
    • setAllowedTools

      @Stability(Stable) public void setAllowedTools(@Nullable List<String> value)
      The tools that the agent is allowed to use.
    • getAuthorizerConfiguration

      @Stability(Stable) @Nullable public Object getAuthorizerConfiguration()
    • setAuthorizerConfiguration

      @Stability(Stable) public void setAuthorizerConfiguration(@Nullable IResolvable value)
    • setAuthorizerConfiguration

      @Stability(Stable) public void setAuthorizerConfiguration(@Nullable CfnHarness.AuthorizerConfigurationProperty value)
    • getEnvironment

      @Stability(Stable) @Nullable public Object getEnvironment()
    • setEnvironment

      @Stability(Stable) public void setEnvironment(@Nullable IResolvable value)
    • setEnvironment

      @Stability(Stable) public void setEnvironment(@Nullable CfnHarness.HarnessEnvironmentProviderProperty value)
    • getEnvironmentArtifact

      @Stability(Stable) @Nullable public Object getEnvironmentArtifact()
    • setEnvironmentArtifact

      @Stability(Stable) public void setEnvironmentArtifact(@Nullable IResolvable value)
    • setEnvironmentArtifact

      @Stability(Stable) public void setEnvironmentArtifact(@Nullable CfnHarness.HarnessEnvironmentArtifactProperty value)
    • getEnvironmentVariables

      @Stability(Stable) @Nullable public Object getEnvironmentVariables()
      Environment variables to set in the harness runtime environment.

      Returns union: either IResolvable or Mapinvalid input: '<'String, String>

    • setEnvironmentVariables

      @Stability(Stable) public void setEnvironmentVariables(@Nullable IResolvable value)
      Environment variables to set in the harness runtime environment.
    • setEnvironmentVariables

      @Stability(Stable) public void setEnvironmentVariables(@Nullable Map<String,String> value)
      Environment variables to set in the harness runtime environment.
    • getMaxIterations

      @Stability(Stable) @Nullable public Number getMaxIterations()
      The maximum number of iterations the agent loop can execute per invocation.
    • setMaxIterations

      @Stability(Stable) public void setMaxIterations(@Nullable Number value)
      The maximum number of iterations the agent loop can execute per invocation.
    • getMaxTokens

      @Stability(Stable) @Nullable public Number getMaxTokens()
      The maximum number of tokens the agent can generate per iteration.
    • setMaxTokens

      @Stability(Stable) public void setMaxTokens(@Nullable Number value)
      The maximum number of tokens the agent can generate per iteration.
    • getMemory

      @Stability(Stable) @Nullable public Object getMemory()
    • setMemory

      @Stability(Stable) public void setMemory(@Nullable IResolvable value)
    • setMemory

      @Stability(Stable) public void setMemory(@Nullable CfnHarness.HarnessMemoryConfigurationProperty value)
    • getSkills

      @Stability(Stable) @Nullable public Object getSkills()
      The skills available to the agent.

      Returns union: either IResolvable or Listinvalid input: '<'either IResolvable or CfnHarness.HarnessSkillProperty>

    • setSkills

      @Stability(Stable) public void setSkills(@Nullable IResolvable value)
      The skills available to the agent.
    • setSkills

      @Stability(Stable) public void setSkills(@Nullable List<Object> value)
      The skills available to the agent.
    • getSystemPrompt

      @Stability(Stable) @Nullable public Object getSystemPrompt()
      The system prompt that defines the agent's behavior.

      Returns union: either IResolvable or Listinvalid input: '<'either IResolvable or CfnHarness.HarnessSystemContentBlockProperty>

    • setSystemPrompt

      @Stability(Stable) public void setSystemPrompt(@Nullable IResolvable value)
      The system prompt that defines the agent's behavior.
    • setSystemPrompt

      @Stability(Stable) public void setSystemPrompt(@Nullable List<Object> value)
      The system prompt that defines the agent's behavior.
    • getTags

      @Stability(Stable) @Nullable public List<CfnTag> getTags()
      Tags to apply to the harness resource.
    • setTags

      @Stability(Stable) public void setTags(@Nullable List<CfnTag> value)
      Tags to apply to the harness resource.
    • getTimeoutSeconds

      @Stability(Stable) @Nullable public Number getTimeoutSeconds()
      The maximum duration in seconds for the agent loop execution per invocation.
    • setTimeoutSeconds

      @Stability(Stable) public void setTimeoutSeconds(@Nullable Number value)
      The maximum duration in seconds for the agent loop execution per invocation.
    • getTools

      @Stability(Stable) @Nullable public Object getTools()
      The tools available to the agent.

      Returns union: either IResolvable or Listinvalid input: '<'either IResolvable or CfnHarness.HarnessToolProperty>

    • setTools

      @Stability(Stable) public void setTools(@Nullable IResolvable value)
      The tools available to the agent.
    • setTools

      @Stability(Stable) public void setTools(@Nullable List<Object> value)
      The tools available to the agent.
    • getTruncation

      @Stability(Stable) @Nullable public Object getTruncation()
    • setTruncation

      @Stability(Stable) public void setTruncation(@Nullable IResolvable value)
    • setTruncation

      @Stability(Stable) public void setTruncation(@Nullable CfnHarness.HarnessTruncationConfigurationProperty value)