import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * Manages an AWS Bedrock AgentCore Harness. A Harness is a managed agent loop that wraps model configuration, tools, skills, memory, and compute environment into a single deployable unit. * * ## Example Usage * * ### Basic Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const assumeRole = aws.iam.getPolicyDocument({ * statements: [{ * principals: [{ * type: "Service", * identifiers: ["bedrock-agentcore.amazonaws.com"], * }], * effect: "Allow", * actions: ["sts:AssumeRole"], * }], * }); * const example = new aws.iam.Role("example", { * name: "bedrock-agentcore-harness-role", * assumeRolePolicy: assumeRole.then(assumeRole => assumeRole.json), * }); * const exampleRolePolicy = new aws.iam.RolePolicy("example", { * role: example.name, * policy: JSON.stringify({ * Version: "2012-10-17", * Statement: [{ * Effect: "Allow", * Action: [ * "bedrock:InvokeModel", * "bedrock:InvokeModelWithResponseStream", * ], * Resource: "*", * }], * }), * }); * const exampleAgentcoreHarness = new aws.bedrock.AgentcoreHarness("example", { * model: { * bedrockModelConfig: { * modelId: "anthropic.claude-sonnet-4-20250514", * }, * }, * systemPrompts: [{ * text: "You are a helpful assistant.", * }], * harnessName: "example_harness", * executionRoleArn: example.arn, * }); * ``` * * ### With Tools and Truncation * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.bedrock.AgentcoreHarness("example", { * model: { * bedrockModelConfig: { * modelId: "anthropic.claude-sonnet-4-20250514", * temperature: 0.7, * topP: 0.9, * }, * }, * systemPrompts: [{ * text: "You are a coding assistant.", * }], * tools: [{ * config: { * inlineFunction: { * description: "Get the current weather for a location", * inputSchema: JSON.stringify({ * type: "object", * properties: { * location: { * type: "string", * description: "City name", * }, * }, * required: ["location"], * }), * }, * }, * type: "inline_function", * name: "get_weather", * }], * truncations: [{ * config: [{ * slidingWindow: [{ * messagesCount: 50, * }], * }], * strategy: "sliding_window", * }], * harnessName: "example_with_tools", * executionRoleArn: exampleAwsIamRole.arn, * allowedTools: ["*"], * maxIterations: 10, * maxTokens: 4096, * timeoutSeconds: 300, * }); * ``` * * ### With Managed Memory * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.bedrock.AgentcoreHarness("example", { * model: { * bedrockModelConfig: { * modelId: "anthropic.claude-sonnet-4-20250514", * }, * }, * memory: { * managedMemoryConfiguration: { * eventExpiryDuration: 14, * strategies: [ * "SEMANTIC", * "SUMMARIZATION", * ], * }, * }, * systemPrompts: [{ * text: "You are a helpful assistant.", * }], * harnessName: "my_harness", * executionRoleArn: exampleAwsIamRole.arn, * }); * ``` * * ## Import * * ### Identity Schema * * #### Required * * - `harnessId` (String) ID of the harness. * * #### Optional * * * `accountId` (String) AWS Account where this resource is managed. * * `region` (String) Region where this resource is managed. * * Using `pulumi import`, import Bedrock AgentCore Harnesses using `harnessId`. For example: * * ```sh * $ pulumi import aws:bedrock/agentcoreHarness:AgentcoreHarness example example-Ab12Cd34Ef * ``` */ export declare class AgentcoreHarness extends pulumi.CustomResource { /** * Get an existing AgentcoreHarness resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input, state?: AgentcoreHarnessState, opts?: pulumi.CustomResourceOptions): AgentcoreHarness; /** * Returns true if the given object is an instance of AgentcoreHarness. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is AgentcoreHarness; /** * List of tool names allowed for the harness. Use `["*"]` to allow all tools. */ readonly allowedTools: pulumi.Output; /** * ARN of the managed memory resource. */ readonly arn: pulumi.Output; /** * Authorization configuration for authenticating requests. See `authorizerConfiguration` Block below. */ readonly authorizerConfiguration: pulumi.Output; /** * Actual deployed environment configuration. See `environmentActual` Block below. */ readonly environmentActuals: pulumi.Output; /** * Environment artifact configuration. See `environmentArtifact` Block below. */ readonly environmentArtifact: pulumi.Output; /** * Map of environment variables. */ readonly environmentVariables: pulumi.Output<{ [key: string]: string; } | undefined>; /** * Compute environment configuration. See `environment` Block below.If not specified, configured values can be found in `environmentActual`. Clearing this value will leave the environment configuration as is, but Terraform will not track changes. */ readonly environments: pulumi.Output; /** * ARN of the IAM role that the harness assumes to access AWS services. */ readonly executionRoleArn: pulumi.Output; /** * Unique identifier of the Harness. */ readonly harnessId: pulumi.Output; /** * Name of the harness. Must be 1-40 characters, alphanumeric and underscores only. */ readonly harnessName: pulumi.Output; /** * Maximum number of iterations the agent loop can perform. */ readonly maxIterations: pulumi.Output; /** * Maximum number of tokens in the model response. */ readonly maxTokens: pulumi.Output; /** * Memory configuration. See `memory` Block below. If not specified, configured values can be found in `memoryActual`. Clearing this value will reset the memory configuration to default values. */ readonly memory: pulumi.Output; /** * Actual deployed memory configuration. See `memoryActual` Block below. */ readonly memoryActuals: pulumi.Output; /** * Model configuration for the harness. See `model` Block below. */ readonly model: pulumi.Output; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ readonly region: pulumi.Output; /** * Skill configurations. See `skill` Block below. */ readonly skills: pulumi.Output; /** * System prompt blocks for the harness. See `systemPrompt` Block below. * * The following arguments are optional: */ readonly systemPrompts: pulumi.Output; /** * Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. */ readonly tags: pulumi.Output<{ [key: string]: string; } | undefined>; /** * Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. */ readonly tagsAll: pulumi.Output<{ [key: string]: string; }>; /** * Timeout in seconds for the harness execution. */ readonly timeoutSeconds: pulumi.Output; readonly timeouts: pulumi.Output; /** * Tool configurations. See `tool` Block below. */ readonly tools: pulumi.Output; /** * Truncation configuration for conversation history. See `truncation` Block below. */ readonly truncations: pulumi.Output; /** * Create a AgentcoreHarness resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: AgentcoreHarnessArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering AgentcoreHarness resources. */ export interface AgentcoreHarnessState { /** * List of tool names allowed for the harness. Use `["*"]` to allow all tools. */ allowedTools?: pulumi.Input[] | undefined>; /** * ARN of the managed memory resource. */ arn?: pulumi.Input; /** * Authorization configuration for authenticating requests. See `authorizerConfiguration` Block below. */ authorizerConfiguration?: pulumi.Input; /** * Actual deployed environment configuration. See `environmentActual` Block below. */ environmentActuals?: pulumi.Input[] | undefined>; /** * Environment artifact configuration. See `environmentArtifact` Block below. */ environmentArtifact?: pulumi.Input; /** * Map of environment variables. */ environmentVariables?: pulumi.Input<{ [key: string]: pulumi.Input; } | undefined>; /** * Compute environment configuration. See `environment` Block below.If not specified, configured values can be found in `environmentActual`. Clearing this value will leave the environment configuration as is, but Terraform will not track changes. */ environments?: pulumi.Input[] | undefined>; /** * ARN of the IAM role that the harness assumes to access AWS services. */ executionRoleArn?: pulumi.Input; /** * Unique identifier of the Harness. */ harnessId?: pulumi.Input; /** * Name of the harness. Must be 1-40 characters, alphanumeric and underscores only. */ harnessName?: pulumi.Input; /** * Maximum number of iterations the agent loop can perform. */ maxIterations?: pulumi.Input; /** * Maximum number of tokens in the model response. */ maxTokens?: pulumi.Input; /** * Memory configuration. See `memory` Block below. If not specified, configured values can be found in `memoryActual`. Clearing this value will reset the memory configuration to default values. */ memory?: pulumi.Input; /** * Actual deployed memory configuration. See `memoryActual` Block below. */ memoryActuals?: pulumi.Input[] | undefined>; /** * Model configuration for the harness. See `model` Block below. */ model?: pulumi.Input; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ region?: pulumi.Input; /** * Skill configurations. See `skill` Block below. */ skills?: pulumi.Input[] | undefined>; /** * System prompt blocks for the harness. See `systemPrompt` Block below. * * The following arguments are optional: */ systemPrompts?: pulumi.Input[] | undefined>; /** * Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. */ tags?: pulumi.Input<{ [key: string]: pulumi.Input; } | undefined>; /** * Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. */ tagsAll?: pulumi.Input<{ [key: string]: pulumi.Input; } | undefined>; /** * Timeout in seconds for the harness execution. */ timeoutSeconds?: pulumi.Input; timeouts?: pulumi.Input; /** * Tool configurations. See `tool` Block below. */ tools?: pulumi.Input[] | undefined>; /** * Truncation configuration for conversation history. See `truncation` Block below. */ truncations?: pulumi.Input[] | undefined>; } /** * The set of arguments for constructing a AgentcoreHarness resource. */ export interface AgentcoreHarnessArgs { /** * List of tool names allowed for the harness. Use `["*"]` to allow all tools. */ allowedTools?: pulumi.Input[] | undefined>; /** * Authorization configuration for authenticating requests. See `authorizerConfiguration` Block below. */ authorizerConfiguration?: pulumi.Input; /** * Environment artifact configuration. See `environmentArtifact` Block below. */ environmentArtifact?: pulumi.Input; /** * Map of environment variables. */ environmentVariables?: pulumi.Input<{ [key: string]: pulumi.Input; } | undefined>; /** * Compute environment configuration. See `environment` Block below.If not specified, configured values can be found in `environmentActual`. Clearing this value will leave the environment configuration as is, but Terraform will not track changes. */ environments?: pulumi.Input[] | undefined>; /** * ARN of the IAM role that the harness assumes to access AWS services. */ executionRoleArn: pulumi.Input; /** * Name of the harness. Must be 1-40 characters, alphanumeric and underscores only. */ harnessName: pulumi.Input; /** * Maximum number of iterations the agent loop can perform. */ maxIterations?: pulumi.Input; /** * Maximum number of tokens in the model response. */ maxTokens?: pulumi.Input; /** * Memory configuration. See `memory` Block below. If not specified, configured values can be found in `memoryActual`. Clearing this value will reset the memory configuration to default values. */ memory?: pulumi.Input; /** * Model configuration for the harness. See `model` Block below. */ model: pulumi.Input; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ region?: pulumi.Input; /** * Skill configurations. See `skill` Block below. */ skills?: pulumi.Input[] | undefined>; /** * System prompt blocks for the harness. See `systemPrompt` Block below. * * The following arguments are optional: */ systemPrompts: pulumi.Input[]>; /** * Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. */ tags?: pulumi.Input<{ [key: string]: pulumi.Input; } | undefined>; /** * Timeout in seconds for the harness execution. */ timeoutSeconds?: pulumi.Input; timeouts?: pulumi.Input; /** * Tool configurations. See `tool` Block below. */ tools?: pulumi.Input[] | undefined>; /** * Truncation configuration for conversation history. See `truncation` Block below. */ truncations?: pulumi.Input[] | undefined>; } //# sourceMappingURL=agentcoreHarness.d.ts.map