Skip to content
v2.274.0

HarnessHookProperty Struct ​

A lifecycle hook configured for one phase of the agent loop.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_bedrockagentcore as bedrockagentcore } from 'aws-cdk-lib';
const harnessHookProperty: bedrockagentcore.CfnHarness.HarnessHookProperty = {
  afterInvocation: {
    name: 'name',
    target: {
      eventBridge: {
        arn: 'arn',
      },
      lambda: {
        arn: 'arn',

        // the properties below are optional
        failureMode: 'failureMode',
        timeoutSeconds: 123,
      },
      sns: {
        arn: 'arn',
      },
    },
  },
  afterToolCall: {
    name: 'name',
    target: {
      eventBridge: {
        arn: 'arn',
      },
      lambda: {
        arn: 'arn',

        // the properties below are optional
        failureMode: 'failureMode',
        timeoutSeconds: 123,
      },
      sns: {
        arn: 'arn',
      },
    },
  },
  beforeInvocation: {
    name: 'name',
    target: {
      eventBridge: {
        arn: 'arn',
      },
      lambda: {
        arn: 'arn',

        // the properties below are optional
        failureMode: 'failureMode',
        timeoutSeconds: 123,
      },
      sns: {
        arn: 'arn',
      },
    },
  },
  beforeToolCall: {
    name: 'name',
    target: {
      eventBridge: {
        arn: 'arn',
      },
      lambda: {
        arn: 'arn',

        // the properties below are optional
        failureMode: 'failureMode',
        timeoutSeconds: 123,
      },
      sns: {
        arn: 'arn',
      },
    },
  },
};

Properties ​

afterInvocationoptionalIResolvable | CfnHarness.HarnessAfterInvocationHookPropertyafter_invocationoptionaltyping.Union[IResolvable, HarnessAfterInvocationHookProperty]afterInvocationoptionalIResolvableAfterInvocationoptionalIResolvableAfterInvocationoptionalinterface{}#
A hook that runs after an agent invocation.
afterToolCalloptionalIResolvable | CfnHarness.HarnessAfterToolCallHookPropertyafter_tool_calloptionaltyping.Union[IResolvable, HarnessAfterToolCallHookProperty]afterToolCalloptionalIResolvableAfterToolCalloptionalIResolvableAfterToolCalloptionalinterface{}#
A hook that runs after each tool call.
beforeInvocationoptionalIResolvable | CfnHarness.HarnessBeforeInvocationHookPropertybefore_invocationoptionaltyping.Union[IResolvable, HarnessBeforeInvocationHookProperty]beforeInvocationoptionalIResolvableBeforeInvocationoptionalIResolvableBeforeInvocationoptionalinterface{}#
A hook that runs before an agent invocation.
beforeToolCalloptionalIResolvable | CfnHarness.HarnessBeforeToolCallHookPropertybefore_tool_calloptionaltyping.Union[IResolvable, HarnessBeforeToolCallHookProperty]beforeToolCalloptionalIResolvableBeforeToolCalloptionalIResolvableBeforeToolCalloptionalinterface{}#
A hook that runs before each tool call.