Skip to content
v2.275.0

CfnHarnessProps Struct ​

Properties for defining a CfnHarness.

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';

declare const additionalParams: any;
declare const awsIam: any;
declare const disabled: any;
declare const inputSchema: any;
declare const none: any;
const cfnHarnessProps: bedrockagentcore.CfnHarnessProps = {
  executionRoleArn: 'executionRoleArn',
  harnessName: 'harnessName',
  model: {
    bedrockModelConfig: {
      modelId: 'modelId',

      // the properties below are optional
      additionalParams: additionalParams,
      apiFormat: 'apiFormat',
      maxTokens: 123,
      temperature: 123,
      topP: 123,
    },
    geminiModelConfig: {
      apiKeyArn: 'apiKeyArn',
      modelId: 'modelId',

      // the properties below are optional
      additionalParams: additionalParams,
      maxTokens: 123,
      temperature: 123,
      topK: 123,
      topP: 123,
    },
    liteLlmModelConfig: {
      modelId: 'modelId',

      // the properties below are optional
      additionalParams: additionalParams,
      apiBase: 'apiBase',
      apiKeyArn: 'apiKeyArn',
      maxTokens: 123,
      temperature: 123,
      topP: 123,
    },
    openAiModelConfig: {
      apiKeyArn: 'apiKeyArn',
      modelId: 'modelId',

      // the properties below are optional
      additionalParams: additionalParams,
      apiBase: 'apiBase',
      apiFormat: 'apiFormat',
      maxTokens: 123,
      temperature: 123,
      topP: 123,
    },
  },

  // the properties below are optional
  allowedTools: ['allowedTools'],
  authorizerConfiguration: {
    customJwtAuthorizer: {
      discoveryUrl: 'discoveryUrl',

      // the properties below are optional
      advertisedScopeMapping: {
        advertisedScopeMappingKey: 'advertisedScopeMapping',
      },
      allowedAudience: ['allowedAudience'],
      allowedClients: ['allowedClients'],
      allowedScopes: ['allowedScopes'],
      customClaims: [{
        authorizingClaimMatchValue: {
          claimMatchOperator: 'claimMatchOperator',
          claimMatchValue: {
            matchValueString: 'matchValueString',
            matchValueStringList: ['matchValueStringList'],
          },
        },
        inboundTokenClaimName: 'inboundTokenClaimName',
        inboundTokenClaimValueType: 'inboundTokenClaimValueType',
      }],
      privateEndpoint: {
        managedVpcResource: {
          endpointIpAddressType: 'endpointIpAddressType',
          subnetIds: ['subnetIds'],
          vpcIdentifier: 'vpcIdentifier',

          // the properties below are optional
          routingDomain: 'routingDomain',
          securityGroupIds: ['securityGroupIds'],
          tags: {
            tagsKey: 'tags',
          },
        },
        selfManagedLatticeResource: {
          resourceConfigurationIdentifier: 'resourceConfigurationIdentifier',
        },
      },
      privateEndpointOverrides: [{
        domain: 'domain',
        privateEndpoint: {
          managedVpcResource: {
            endpointIpAddressType: 'endpointIpAddressType',
            subnetIds: ['subnetIds'],
            vpcIdentifier: 'vpcIdentifier',

            // the properties below are optional
            routingDomain: 'routingDomain',
            securityGroupIds: ['securityGroupIds'],
            tags: {
              tagsKey: 'tags',
            },
          },
          selfManagedLatticeResource: {
            resourceConfigurationIdentifier: 'resourceConfigurationIdentifier',
          },
        },
      }],
    },
  },
  environment: {
    agentCoreRuntimeEnvironment: {
      agentRuntimeArn: 'agentRuntimeArn',
      agentRuntimeId: 'agentRuntimeId',
      agentRuntimeName: 'agentRuntimeName',
      filesystemConfigurations: [{
        efsAccessPoint: {
          accessPointArn: 'accessPointArn',
          mountPath: 'mountPath',
        },
        s3FilesAccessPoint: {
          accessPointArn: 'accessPointArn',
          mountPath: 'mountPath',
        },
        sessionStorage: {
          mountPath: 'mountPath',
        },
      }],
      lifecycleConfiguration: {
        idleRuntimeSessionTimeout: 123,
        maxLifetime: 123,
      },
      networkConfiguration: {
        networkMode: 'networkMode',

        // the properties below are optional
        networkModeConfig: {
          securityGroups: ['securityGroups'],
          subnets: ['subnets'],
        },
      },
    },
  },
  environmentArtifact: {
    containerConfiguration: {
      containerUri: 'containerUri',
    },
  },
  environmentVariables: {
    environmentVariablesKey: 'environmentVariables',
  },
  hooks: [{
    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',
        },
      },
    },
  }],
  maxIterations: 123,
  maxTokens: 123,
  memory: {
    agentCoreMemoryConfiguration: {
      arn: 'arn',

      // the properties below are optional
      actorId: 'actorId',
      messagesCount: 123,
      retrievalConfig: {
        retrievalConfigKey: {
          relevanceScore: 123,
          strategyId: 'strategyId',
          topK: 123,
        },
      },
    },
    disabled: disabled,
    managedMemoryConfiguration: {
      arn: 'arn',
      encryptionKeyArn: 'encryptionKeyArn',
      eventExpiryDuration: 123,
      strategies: ['strategies'],
    },
  },
  skills: [{
    awsSkills: {
      paths: ['paths'],
    },
    git: {
      url: 'url',

      // the properties below are optional
      auth: {
        credentialArn: 'credentialArn',

        // the properties below are optional
        username: 'username',
      },
      path: 'path',
    },
    path: 'path',
    s3: {
      uri: 'uri',
    },
  }],
  systemPrompt: [{
    text: 'text',
  }],
  tags: [{
    key: 'key',
    value: 'value',
  }],
  timeoutSeconds: 123,
  tools: [{
    type: 'type',

    // the properties below are optional
    config: {
      agentCoreBrowser: {
        browserArn: 'browserArn',
      },
      agentCoreCodeInterpreter: {
        codeInterpreterArn: 'codeInterpreterArn',
      },
      agentCoreGateway: {
        gatewayArn: 'gatewayArn',

        // the properties below are optional
        outboundAuth: {
          awsIam: awsIam,
          none: none,
          oauth: {
            providerArn: 'providerArn',
            scopes: ['scopes'],

            // the properties below are optional
            customParameters: {
              customParametersKey: 'customParameters',
            },
            defaultReturnUrl: 'defaultReturnUrl',
            grantType: 'grantType',
          },
        },
      },
      inlineFunction: {
        description: 'description',
        inputSchema: inputSchema,
      },
      remoteMcp: {
        url: 'url',

        // the properties below are optional
        headers: {
          headersKey: 'headers',
        },
      },
    },
    name: 'name',
  }],
  truncation: {
    strategy: 'strategy',

    // the properties below are optional
    config: {
      slidingWindow: {
        messagesCount: 123,
      },
      summarization: {
        preserveRecentMessages: 123,
        summarizationSystemPrompt: 'summarizationSystemPrompt',
        summaryRatio: 123,
      },
    },
  },
};

Properties ​

allowedToolsoptionalstring[]allowed_toolsoptionaltyping.List[str]allowedToolsoptionalList<String>AllowedToolsoptionalstring[]AllowedToolsoptional*[]*string#
The tools that the agent is allowed to use.
authorizerConfigurationoptionalIResolvable | CfnHarness.AuthorizerConfigurationPropertyauthorizer_configurationoptionaltyping.Union[IResolvable, AuthorizerConfigurationProperty]authorizerConfigurationoptionalIResolvableAuthorizerConfigurationoptionalIResolvableAuthorizerConfigurationoptionalinterface{}#
environmentoptionalIResolvable | CfnHarness.HarnessEnvironmentProviderPropertyenvironmentoptionaltyping.Union[IResolvable, HarnessEnvironmentProviderProperty]environmentoptionalIResolvableEnvironmentoptionalIResolvableEnvironmentoptionalinterface{}#
environmentArtifactoptionalIResolvable | CfnHarness.HarnessEnvironmentArtifactPropertyenvironment_artifactoptionaltyping.Union[IResolvable, HarnessEnvironmentArtifactProperty]environmentArtifactoptionalIResolvableEnvironmentArtifactoptionalIResolvableEnvironmentArtifactoptionalinterface{}#
environmentVariablesoptionalIResolvable | { [key: string]: string }environment_variablesoptionaltyping.Union[IResolvable, typing.Mapping[str, str]]environmentVariablesoptionalIResolvableEnvironmentVariablesoptionalIResolvableEnvironmentVariablesoptionalinterface{}#
Environment variables to set in the harness runtime environment.
executionRoleArnstringexecution_role_arnstrexecutionRoleArnStringExecutionRoleArnstringExecutionRoleArn*stringrequired#
The ARN of the IAM role that the harness assumes when running.
harnessNamestringharness_namestrharnessNameStringHarnessNamestringHarnessName*stringrequired#
The name of the harness.
hooksoptionalIResolvable | IResolvable | CfnHarness.HarnessHookProperty[]hooksoptionaltyping.Union[IResolvable, typing.List[typing.Union[IResolvable, HarnessHookProperty]]]hooksoptionalIResolvableHooksoptionalIResolvableHooksoptionalinterface{}#
Lifecycle hooks that fire at well-defined points in the agent loop for policy enforcement, audit, and governance.
maxIterationsoptionalnumbermax_iterationsoptionalint | floatmaxIterationsoptionalNumberMaxIterationsoptionaldoubleMaxIterationsoptional*float64#
The maximum number of iterations the agent loop can execute per invocation.
maxTokensoptionalnumbermax_tokensoptionalint | floatmaxTokensoptionalNumberMaxTokensoptionaldoubleMaxTokensoptional*float64#
The maximum number of tokens the agent can generate per iteration.
memoryoptionalIResolvable | CfnHarness.HarnessMemoryConfigurationPropertymemoryoptionaltyping.Union[IResolvable, HarnessMemoryConfigurationProperty]memoryoptionalIResolvableMemoryoptionalIResolvableMemoryoptionalinterface{}#
skillsoptionalIResolvable | IResolvable | CfnHarness.HarnessSkillProperty[]skillsoptionaltyping.Union[IResolvable, typing.List[typing.Union[IResolvable, HarnessSkillProperty]]]skillsoptionalIResolvableSkillsoptionalIResolvableSkillsoptionalinterface{}#
The skills available to the agent.
systemPromptoptionalIResolvable | IResolvable | CfnHarness.HarnessSystemContentBlockProperty[]system_promptoptionaltyping.Union[IResolvable, typing.List[typing.Union[IResolvable, HarnessSystemContentBlockProperty]]]systemPromptoptionalIResolvableSystemPromptoptionalIResolvableSystemPromptoptionalinterface{}#
The system prompt that defines the agent's behavior.
tagsoptionalCfnTag[]tagsoptionaltyping.List[CfnTag]tagsoptionalList<CfnTag>TagsoptionalCfnTag[]Tagsoptional*[]CfnTag#
Tags to apply to the harness resource.
timeoutSecondsoptionalnumbertimeout_secondsoptionalint | floattimeoutSecondsoptionalNumberTimeoutSecondsoptionaldoubleTimeoutSecondsoptional*float64#
The maximum duration in seconds for the agent loop execution per invocation.
toolsoptionalIResolvable | IResolvable | CfnHarness.HarnessToolProperty[]toolsoptionaltyping.Union[IResolvable, typing.List[typing.Union[IResolvable, HarnessToolProperty]]]toolsoptionalIResolvableToolsoptionalIResolvableToolsoptionalinterface{}#
The tools available to the agent.
truncationoptionalIResolvable | CfnHarness.HarnessTruncationConfigurationPropertytruncationoptionaltyping.Union[IResolvable, HarnessTruncationConfigurationProperty]truncationoptionalIResolvableTruncationoptionalIResolvableTruncationoptionalinterface{}#