Class CfnHarness
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.bedrockagentcore.CfnHarness
- 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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceExample:static interfaceExample:static final classA fluent builder forCfnHarness.static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.interfaces.bedrockagentcore.IHarnessRef
IHarnessRef.Jsii$Default, IHarnessRef.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.ITaggableV2
ITaggableV2.Jsii$Default, ITaggableV2.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe CloudFormation resource type name for this resource class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCfnHarness(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnHarness(software.amazon.jsii.JsiiObjectRef objRef) CfnHarness(software.constructs.Construct scope, String id, CfnHarnessProps props) Create a newAWS::BedrockAgentCore::Harness. -
Method Summary
Modifier and TypeMethodDescriptionstatic StringarnForHarness(IHarnessRef resource) The tools that the agent is allowed to use.The Amazon Resource Name (ARN) of the harness.The timestamp when the harness was created.The ARN of the underlying AgentCore Runtime.The ID of the underlying AgentCore Runtime.The name of the underlying AgentCore Runtime.The unique identifier of the harness.The timestamp when the harness was last updated.Returns union: eitherIResolvableorCfnHarness.AuthorizerConfigurationPropertyTag Manager which manages the tags for this resource.Returns union: eitherIResolvableorCfnHarness.HarnessEnvironmentProviderPropertyReturns union: eitherIResolvableorCfnHarness.HarnessEnvironmentArtifactPropertyEnvironment variables to set in the harness runtime environment.The ARN of the IAM role that the harness assumes when running.The name of the harness.A reference to a Harness resource.The maximum number of iterations the agent loop can execute per invocation.The maximum number of tokens the agent can generate per iteration.Returns union: eitherIResolvableorCfnHarness.HarnessMemoryConfigurationPropertygetModel()Returns union: eitherIResolvableorCfnHarness.HarnessModelConfigurationPropertyThe skills available to the agent.The system prompt that defines the agent's behavior.getTags()Tags to apply to the harness resource.The maximum duration in seconds for the agent loop execution per invocation.getTools()The tools available to the agent.Returns union: eitherIResolvableorCfnHarness.HarnessTruncationConfigurationPropertyvoidinspect(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.static BooleanChecks whether the given object is a CfnHarness.renderProperties(Map<String, Object> props) voidsetAllowedTools(List<String> value) The tools that the agent is allowed to use.voidvoidvoidsetEnvironment(IResolvable value) voidvoidvoidvoidsetEnvironmentVariables(Map<String, String> value) Environment variables to set in the harness runtime environment.voidEnvironment variables to set in the harness runtime environment.voidsetExecutionRoleArn(String value) The ARN of the IAM role that the harness assumes when running.voidsetHarnessName(String value) The name of the harness.voidsetMaxIterations(Number value) The maximum number of iterations the agent loop can execute per invocation.voidsetMaxTokens(Number value) The maximum number of tokens the agent can generate per iteration.voidsetMemory(IResolvable value) voidvoidsetModel(IResolvable value) voidvoidThe skills available to the agent.voidsetSkills(IResolvable value) The skills available to the agent.voidsetSystemPrompt(List<Object> value) The system prompt that defines the agent's behavior.voidsetSystemPrompt(IResolvable value) The system prompt that defines the agent's behavior.voidTags to apply to the harness resource.voidsetTimeoutSeconds(Number value) The maximum duration in seconds for the agent loop execution per invocation.voidThe tools available to the agent.voidsetTools(IResolvable value) The tools available to the agent.voidsetTruncation(IResolvable value) voidMethods inherited from class software.amazon.awscdk.CfnResource
addDeletionOverride, addDependency, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyCrossStackReferenceStrength, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, cfnPropertyName, getAtt, getAtt, getCfnOptions, getCfnResourceType, getEnv, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, obtainDependencies, obtainResourceDependencies, removeDependency, replaceDependency, shouldSynthesize, toString, validatePropertiesMethods inherited from class software.amazon.awscdk.CfnRefElement
getRefMethods inherited from class software.amazon.awscdk.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalId, withMethods inherited from class software.constructs.Construct
getNode, isConstructMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.constructs.IConstruct
getNode, withMethods inherited from interface software.amazon.awscdk.interfaces.IEnvironmentAware
getEnvMethods 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
-
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 newAWS::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
- Parameters:
resource- This parameter is required.
-
isCfnHarness
Checks whether the given object is a CfnHarness.- Parameters:
x- This parameter is required.
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspectin 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:
renderPropertiesin classCfnResource- Parameters:
props- This parameter is required.
-
getAttrArn
The Amazon Resource Name (ARN) of the harness. -
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
The unique identifier of the harness. -
getAttrStatus
-
getAttrUpdatedAt
The timestamp when the harness was last updated. -
getCdkTagManager
Tag Manager which manages the tags for this resource.- Specified by:
getCdkTagManagerin interfaceITaggableV2
-
getCfnProperties
- Overrides:
getCfnPropertiesin classCfnResource
-
getCfnPropertyNames
- Overrides:
getCfnPropertyNamesin classCfnResource
-
getHarnessRef
A reference to a Harness resource.- Specified by:
getHarnessRefin interfaceIHarnessRef
-
getExecutionRoleArn
The ARN of the IAM role that the harness assumes when running. -
setExecutionRoleArn
The ARN of the IAM role that the harness assumes when running. -
getHarnessName
The name of the harness. -
setHarnessName
The name of the harness. -
getModel
Returns union: eitherIResolvableorCfnHarness.HarnessModelConfigurationProperty -
setModel
-
setModel
@Stability(Stable) public void setModel(@NotNull CfnHarness.HarnessModelConfigurationProperty value) -
getAllowedTools
The tools that the agent is allowed to use. -
setAllowedTools
The tools that the agent is allowed to use. -
getAuthorizerConfiguration
Returns union: eitherIResolvableorCfnHarness.AuthorizerConfigurationProperty -
setAuthorizerConfiguration
-
setAuthorizerConfiguration
@Stability(Stable) public void setAuthorizerConfiguration(@Nullable CfnHarness.AuthorizerConfigurationProperty value) -
getEnvironment
Returns union: eitherIResolvableorCfnHarness.HarnessEnvironmentProviderProperty -
setEnvironment
-
setEnvironment
@Stability(Stable) public void setEnvironment(@Nullable CfnHarness.HarnessEnvironmentProviderProperty value) -
getEnvironmentArtifact
Returns union: eitherIResolvableorCfnHarness.HarnessEnvironmentArtifactProperty -
setEnvironmentArtifact
-
setEnvironmentArtifact
@Stability(Stable) public void setEnvironmentArtifact(@Nullable CfnHarness.HarnessEnvironmentArtifactProperty value) -
getEnvironmentVariables
Environment variables to set in the harness runtime environment.Returns union: either
IResolvableor Mapinvalid input: '<'String,String> -
setEnvironmentVariables
Environment variables to set in the harness runtime environment. -
setEnvironmentVariables
Environment variables to set in the harness runtime environment. -
getMaxIterations
The maximum number of iterations the agent loop can execute per invocation. -
setMaxIterations
The maximum number of iterations the agent loop can execute per invocation. -
getMaxTokens
The maximum number of tokens the agent can generate per iteration. -
setMaxTokens
The maximum number of tokens the agent can generate per iteration. -
getMemory
Returns union: eitherIResolvableorCfnHarness.HarnessMemoryConfigurationProperty -
setMemory
-
setMemory
@Stability(Stable) public void setMemory(@Nullable CfnHarness.HarnessMemoryConfigurationProperty value) -
getSkills
The skills available to the agent.Returns union: either
IResolvableor Listinvalid input: '<'eitherIResolvableorCfnHarness.HarnessSkillProperty> -
setSkills
The skills available to the agent. -
setSkills
The skills available to the agent. -
getSystemPrompt
The system prompt that defines the agent's behavior.Returns union: either
IResolvableor Listinvalid input: '<'eitherIResolvableorCfnHarness.HarnessSystemContentBlockProperty> -
setSystemPrompt
The system prompt that defines the agent's behavior. -
setSystemPrompt
The system prompt that defines the agent's behavior. -
getTags
Tags to apply to the harness resource. -
setTags
Tags to apply to the harness resource. -
getTimeoutSeconds
The maximum duration in seconds for the agent loop execution per invocation. -
setTimeoutSeconds
The maximum duration in seconds for the agent loop execution per invocation. -
getTools
The tools available to the agent.Returns union: either
IResolvableor Listinvalid input: '<'eitherIResolvableorCfnHarness.HarnessToolProperty> -
setTools
The tools available to the agent. -
setTools
The tools available to the agent. -
getTruncation
Returns union: eitherIResolvableorCfnHarness.HarnessTruncationConfigurationProperty -
setTruncation
-
setTruncation
@Stability(Stable) public void setTruncation(@Nullable CfnHarness.HarnessTruncationConfigurationProperty value)
-