@aws/agentcore 1.0.0-rc.1 → 1.0.0-rc.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +175 -0
- package/README.md +93 -985
- package/dist/assets/agent-inspector/index.js.asset +1 -1
- package/dist/assets/cdk/README.md +42 -19
- package/dist/assets/cdk/bin/cdk.ts +22 -173
- package/dist/assets/cdk/lib/cdk-stack.ts +18 -80
- package/dist/assets/cdk/package.json +3 -10
- package/dist/assets/cdk/tsconfig.json +1 -1
- package/dist/assets/evaluators/python-lambda/README.md +5 -1
- package/dist/assets/templates/a2a-python-strands/pyproject.toml +1 -1
- package/dist/assets/templates/agent-python-langchain/README.md +5 -4
- package/dist/assets/templates/agent-python-langchain/main.py +7 -11
- package/dist/assets/templates/agent-python-strands/README.md +16 -2
- package/dist/assets/templates/agent-python-strands/main.py +40 -81
- package/dist/assets/templates/agent-python-strands/memory/session.py +1 -5
- package/dist/assets/templates/agent-python-strands/model/load.py +4 -4
- package/dist/assets/templates/agent-python-strands/parse.py +41 -0
- package/dist/assets/templates/agent-typescript-strands/README.md +23 -2
- package/dist/assets/templates/agent-typescript-strands/main.ts +4 -13
- package/dist/assets/templates/agent-typescript-strands/memory/memory.ts +1 -12
- package/dist/assets/templates/agent-typescript-strands/package.json.template +0 -1
- package/dist/assets/templates/agui-python-strands/README.md +1 -1
- package/dist/assets/templates/agui-python-strands/pyproject.toml +1 -1
- package/dist/assets/templates/export-harness-python/model/load.py +3 -3
- package/dist/assets/templates/harness/harness.yaml +225 -0
- package/dist/main.js +728 -220
- package/package.json +13 -6
- package/dist/assets/cdk/.prettierrc +0 -8
- package/dist/assets/cdk/jest.config.js +0 -9
- package/dist/assets/cdk/npmignore.template +0 -6
- package/dist/assets/cdk/test/cdk.test.ts +0 -120
- package/dist/assets/evaluators/autoevals-lambda/README.md +0 -23
- package/dist/assets/evaluators/autoevals-lambda/execution-role-policy.json +0 -15
- package/dist/assets/evaluators/autoevals-lambda/lambda_function.py +0 -37
- package/dist/assets/evaluators/autoevals-lambda/pyproject.toml +0 -23
- package/dist/assets/evaluators/deepeval-lambda/README.md +0 -23
- package/dist/assets/evaluators/deepeval-lambda/execution-role-policy.json +0 -15
- package/dist/assets/evaluators/deepeval-lambda/lambda_function.py +0 -29
- package/dist/assets/evaluators/deepeval-lambda/pyproject.toml +0 -22
- package/dist/assets/templates/agent-typescript-strands/mcp_client/client.ts +0 -11
|
@@ -12,7 +12,7 @@ import os
|
|
|
12
12
|
from strands.models.anthropic import AnthropicModel
|
|
13
13
|
from bedrock_agentcore.identity.auth import requires_api_key
|
|
14
14
|
|
|
15
|
-
IDENTITY_PROVIDER_NAME = "{{identityProviders.[0].name}}"
|
|
15
|
+
IDENTITY_PROVIDER_NAME = os.environ.get("{{identityProviders.[0].envVarName}}_NAME", "{{identityProviders.[0].name}}")
|
|
16
16
|
IDENTITY_ENV_VAR = "{{identityProviders.[0].envVarName}}"
|
|
17
17
|
|
|
18
18
|
|
|
@@ -51,7 +51,7 @@ import os
|
|
|
51
51
|
from strands.models.openai import OpenAIModel
|
|
52
52
|
from bedrock_agentcore.identity.auth import requires_api_key
|
|
53
53
|
|
|
54
|
-
IDENTITY_PROVIDER_NAME = "{{identityProviders.[0].name}}"
|
|
54
|
+
IDENTITY_PROVIDER_NAME = os.environ.get("{{identityProviders.[0].envVarName}}_NAME", "{{identityProviders.[0].name}}")
|
|
55
55
|
IDENTITY_ENV_VAR = "{{identityProviders.[0].envVarName}}"
|
|
56
56
|
|
|
57
57
|
|
|
@@ -89,7 +89,7 @@ import os
|
|
|
89
89
|
from strands.models.gemini import GeminiModel
|
|
90
90
|
from bedrock_agentcore.identity.auth import requires_api_key
|
|
91
91
|
|
|
92
|
-
IDENTITY_PROVIDER_NAME = "{{identityProviders.[0].name}}"
|
|
92
|
+
IDENTITY_PROVIDER_NAME = os.environ.get("{{identityProviders.[0].envVarName}}_NAME", "{{identityProviders.[0].name}}")
|
|
93
93
|
IDENTITY_ENV_VAR = "{{identityProviders.[0].envVarName}}"
|
|
94
94
|
|
|
95
95
|
|
|
@@ -130,7 +130,7 @@ from strands.models.litellm import LiteLLMModel
|
|
|
130
130
|
{{#if identityProviders.[0].name}}
|
|
131
131
|
from bedrock_agentcore.identity.auth import requires_api_key
|
|
132
132
|
|
|
133
|
-
IDENTITY_PROVIDER_NAME = "{{identityProviders.[0].name}}"
|
|
133
|
+
IDENTITY_PROVIDER_NAME = os.environ.get("{{identityProviders.[0].envVarName}}_NAME", "{{identityProviders.[0].name}}")
|
|
134
134
|
IDENTITY_ENV_VAR = "{{identityProviders.[0].envVarName}}"
|
|
135
135
|
|
|
136
136
|
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
from typing import Any
|
|
2
|
+
|
|
3
|
+
def _strip_trailing_tool_use(messages: Any) -> list[dict]:
|
|
4
|
+
"""Strip toolUse blocks from the tail until the last message has none."""
|
|
5
|
+
if not isinstance(messages, list):
|
|
6
|
+
raise ValueError("messages must be a list")
|
|
7
|
+
|
|
8
|
+
messages = list(messages)
|
|
9
|
+
while messages:
|
|
10
|
+
last = messages[-1]
|
|
11
|
+
if not isinstance(last, dict):
|
|
12
|
+
raise ValueError("each message must be an object")
|
|
13
|
+
original_content = last.get("content", [])
|
|
14
|
+
if not isinstance(original_content, list) or not all(isinstance(block, dict) for block in original_content):
|
|
15
|
+
raise ValueError("each message content value must be a list of content blocks")
|
|
16
|
+
|
|
17
|
+
content = [block for block in original_content if "toolUse" not in block]
|
|
18
|
+
if len(content) == len(original_content):
|
|
19
|
+
break
|
|
20
|
+
if content:
|
|
21
|
+
messages[-1] = {**last, "content": content}
|
|
22
|
+
break
|
|
23
|
+
messages.pop()
|
|
24
|
+
|
|
25
|
+
return messages
|
|
26
|
+
|
|
27
|
+
def parse_payload(payload: dict):
|
|
28
|
+
"""Accept a caller-supplied message history or a plain prompt string."""
|
|
29
|
+
if not isinstance(payload, dict):
|
|
30
|
+
raise ValueError("payload must be a JSON object")
|
|
31
|
+
actor_id = payload.get("actorId", "default")
|
|
32
|
+
if not isinstance(actor_id, str):
|
|
33
|
+
raise ValueError("actorId must be a string")
|
|
34
|
+
if not actor_id:
|
|
35
|
+
actor_id = "default"
|
|
36
|
+
if "messages" in payload:
|
|
37
|
+
return _strip_trailing_tool_use(payload["messages"]), actor_id
|
|
38
|
+
prompt = payload.get("prompt", "")
|
|
39
|
+
if not isinstance(prompt, str):
|
|
40
|
+
raise ValueError("prompt must be a string")
|
|
41
|
+
return prompt, actor_id
|
|
@@ -15,8 +15,23 @@ defines an HTTP server that streams tokens from your chosen Agent framework SDK.
|
|
|
15
15
|
|
|
16
16
|
## Input Validation
|
|
17
17
|
|
|
18
|
-
The generated Zod request schema keeps
|
|
19
|
-
validation when extending the request shape, and pass only prompt text to the agent.
|
|
18
|
+
The generated Zod request schema keeps the prompt and actor ID typed as strings before forwarding them to Strands.
|
|
19
|
+
Retain this validation when extending the request shape, and pass only prompt text to the agent.
|
|
20
|
+
|
|
21
|
+
## Payload
|
|
22
|
+
|
|
23
|
+
The Runtime accepts a JSON object with:
|
|
24
|
+
|
|
25
|
+
- `prompt` (string) — a single user message; defaults to `""`.
|
|
26
|
+
- `actorId` (string, optional) — identifies the end user for Memory scoping (for example,
|
|
27
|
+
`/users/{actorId}/facts`); defaults to `"default"`.
|
|
28
|
+
|
|
29
|
+
The `sessionId` is not in the body. It comes from the
|
|
30
|
+
`X-Amzn-Bedrock-AgentCore-Runtime-Session-Id` header (`context.sessionId`); reuse it to continue a conversation.
|
|
31
|
+
|
|
32
|
+
```json
|
|
33
|
+
{ "prompt": "What's the weather?", "actorId": "user-123" }
|
|
34
|
+
```
|
|
20
35
|
|
|
21
36
|
# Developing locally
|
|
22
37
|
|
|
@@ -27,3 +42,9 @@ If installation was successful, `node_modules/` is already populated with depend
|
|
|
27
42
|
# Deployment
|
|
28
43
|
|
|
29
44
|
After providing credentials, `agentcore project deploy` will deploy your project into Amazon Bedrock AgentCore.
|
|
45
|
+
|
|
46
|
+
Invoke the deployed Runtime with its native payload:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
agentcore project invoke runtime --payload '{"prompt":"Hello!","actorId":"user-123"}'
|
|
50
|
+
```
|
|
@@ -1,14 +1,8 @@
|
|
|
1
1
|
import { BedrockAgentCoreApp } from 'bedrock-agentcore/runtime';
|
|
2
|
-
import { Agent,
|
|
2
|
+
import { Agent, tool, type ToolList } from '@strands-agents/sdk';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
import { loadModel } from './model/load.js';
|
|
5
|
-
import {
|
|
6
|
-
import { getActorId, getOrCreateMemoryManager } from './memory/memory.js';
|
|
7
|
-
|
|
8
|
-
// Define a collection of MCP clients (filter out anything that failed to initialize)
|
|
9
|
-
const mcpClients: McpClient[] = [getStreamableHttpMcpClient()].filter(
|
|
10
|
-
(client): client is McpClient => Boolean(client)
|
|
11
|
-
);
|
|
5
|
+
import { getOrCreateMemoryManager } from './memory/memory.js';
|
|
12
6
|
|
|
13
7
|
// Define a collection of tools used by the model
|
|
14
8
|
const tools: ToolList = [];
|
|
@@ -25,16 +19,13 @@ const addNumbers = tool({
|
|
|
25
19
|
});
|
|
26
20
|
tools.push(addNumbers);
|
|
27
21
|
|
|
28
|
-
// Add MCP clients to tools
|
|
29
|
-
tools.push(...mcpClients);
|
|
30
|
-
|
|
31
22
|
const SYSTEM_PROMPT = `
|
|
32
23
|
You are a helpful assistant. Use tools when appropriate.
|
|
33
24
|
`;
|
|
34
25
|
|
|
35
26
|
const requestSchema = z.object({
|
|
36
27
|
prompt: z.string().default(''),
|
|
37
|
-
|
|
28
|
+
actorId: z.string().default('default').transform((actorId) => actorId || 'default'),
|
|
38
29
|
});
|
|
39
30
|
|
|
40
31
|
const agentCache = new Map<string, Agent>();
|
|
@@ -60,7 +51,7 @@ const app = new BedrockAgentCoreApp({
|
|
|
60
51
|
requestSchema,
|
|
61
52
|
async *process(payload, context) {
|
|
62
53
|
const sessionId = context?.sessionId ?? 'default-session';
|
|
63
|
-
const actorId =
|
|
54
|
+
const actorId = payload.actorId;
|
|
64
55
|
const agent = await getOrCreateAgent(sessionId, actorId);
|
|
65
56
|
|
|
66
57
|
try {
|
|
@@ -1,19 +1,8 @@
|
|
|
1
|
-
import { randomUUID } from 'node:crypto';
|
|
2
1
|
import { MemoryManager } from '@strands-agents/sdk';
|
|
3
2
|
import { createAgentCoreMemoryStores } from 'bedrock-agentcore/experimental/memory/strands';
|
|
4
3
|
|
|
5
4
|
const MEMORY_ID = process.env.{{memoryEnvVarName}};
|
|
6
5
|
|
|
7
|
-
const CUSTOM_ACTOR_ID_HEADER = 'x-amzn-bedrock-agentcore-runtime-custom-actor-id';
|
|
8
|
-
|
|
9
|
-
export function getActorId(payload: any, context: any): string {
|
|
10
|
-
const raw =
|
|
11
|
-
context?.headers?.[CUSTOM_ACTOR_ID_HEADER] ||
|
|
12
|
-
payload?.userId ||
|
|
13
|
-
context?.sessionId;
|
|
14
|
-
return typeof raw === 'string' && raw.trim().length > 0 ? raw.trim() : randomUUID();
|
|
15
|
-
}
|
|
16
|
-
|
|
17
6
|
const memoryManagerCache = new Map<string, MemoryManager>();
|
|
18
7
|
|
|
19
8
|
export function getOrCreateMemoryManager(sessionId: string, actorId: string): MemoryManager | null {
|
|
@@ -31,7 +20,7 @@ export function getOrCreateMemoryManager(sessionId: string, actorId: string): Me
|
|
|
31
20
|
{ namespace: '/users/{actorId}/facts' },
|
|
32
21
|
{ namespace: '/users/{actorId}/preferences' },
|
|
33
22
|
{ namespace: '/episodes/{actorId}/{sessionId}' },
|
|
34
|
-
{ namespace: '/summaries/{actorId}
|
|
23
|
+
{ namespace: '/summaries/{actorId}' },
|
|
35
24
|
],
|
|
36
25
|
// readMode defaults to 'per-namespace' (one retrieve call per namespace).
|
|
37
26
|
// Switch to 'subtree' to consolidate to a single hierarchical recall call.
|
|
@@ -32,7 +32,7 @@ health at `http://127.0.0.1:8080/ping`.
|
|
|
32
32
|
runtime with an AG-UI `RunAgentInput` payload:
|
|
33
33
|
|
|
34
34
|
```bash
|
|
35
|
-
agentcore project invoke runtime --name
|
|
35
|
+
agentcore project invoke runtime --name {{ name }} \
|
|
36
36
|
--payload '{"threadId":"t1","runId":"r1","state":{},"messages":[{"id":"m1","role":"user","content":"Hello!"}],"tools":[],"context":[],"forwardedProps":{}}'
|
|
37
37
|
```
|
|
38
38
|
|
|
@@ -11,7 +11,7 @@ requires-python = ">=3.12"
|
|
|
11
11
|
dependencies = [
|
|
12
12
|
"ag-ui-strands >= 0.3.0, < 0.4.0",
|
|
13
13
|
"ag-ui-protocol >= 0.1.19, < 0.2.0",
|
|
14
|
-
"aws-opentelemetry-distro ~= 0.
|
|
14
|
+
"aws-opentelemetry-distro ~= 0.18.0",
|
|
15
15
|
"bedrock-agentcore ~= 1.9.1",
|
|
16
16
|
"botocore[crt] ~= 1.43.0",
|
|
17
17
|
"strands-agents ~= 1.15.0",
|
|
@@ -89,7 +89,7 @@ from strands.models.openai import OpenAIModel
|
|
|
89
89
|
{{/if}}
|
|
90
90
|
from bedrock_agentcore.identity.auth import requires_api_key
|
|
91
91
|
|
|
92
|
-
IDENTITY_PROVIDER_NAME = "{{identityProviders.[0].name}}"
|
|
92
|
+
IDENTITY_PROVIDER_NAME = os.environ.get("{{identityProviders.[0].envVarName}}_NAME", "{{identityProviders.[0].name}}")
|
|
93
93
|
IDENTITY_ENV_VAR = "{{identityProviders.[0].envVarName}}"
|
|
94
94
|
|
|
95
95
|
|
|
@@ -138,7 +138,7 @@ import os
|
|
|
138
138
|
from strands.models.gemini import GeminiModel
|
|
139
139
|
from bedrock_agentcore.identity.auth import requires_api_key
|
|
140
140
|
|
|
141
|
-
IDENTITY_PROVIDER_NAME = "{{identityProviders.[0].name}}"
|
|
141
|
+
IDENTITY_PROVIDER_NAME = os.environ.get("{{identityProviders.[0].envVarName}}_NAME", "{{identityProviders.[0].name}}")
|
|
142
142
|
IDENTITY_ENV_VAR = "{{identityProviders.[0].envVarName}}"
|
|
143
143
|
|
|
144
144
|
|
|
@@ -194,7 +194,7 @@ from strands.models.litellm import LiteLLMModel
|
|
|
194
194
|
{{#if identityProviders.[0].name}}
|
|
195
195
|
from bedrock_agentcore.identity.auth import requires_api_key
|
|
196
196
|
|
|
197
|
-
IDENTITY_PROVIDER_NAME = "{{identityProviders.[0].name}}"
|
|
197
|
+
IDENTITY_PROVIDER_NAME = os.environ.get("{{identityProviders.[0].envVarName}}_NAME", "{{identityProviders.[0].name}}")
|
|
198
198
|
IDENTITY_ENV_VAR = "{{identityProviders.[0].envVarName}}"
|
|
199
199
|
|
|
200
200
|
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
# Harness configuration: https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/harness.html
|
|
2
|
+
|
|
3
|
+
{{yaml.name}}
|
|
4
|
+
|
|
5
|
+
# https://docs.aws.amazon.com/bedrock-agentcore-control/latest/APIReference/API_HarnessModelConfiguration.html
|
|
6
|
+
{{yaml.model}}
|
|
7
|
+
{{#unless model.temperature includeZero=true}}
|
|
8
|
+
# temperature: 0.2
|
|
9
|
+
{{/unless}}
|
|
10
|
+
{{#unless model.topP includeZero=true}}
|
|
11
|
+
# topP: 0.9
|
|
12
|
+
{{/unless}}
|
|
13
|
+
{{#if modelMaxTokensExample}}
|
|
14
|
+
# maxTokens: 4096
|
|
15
|
+
{{/if}}
|
|
16
|
+
{{#if (or (eq model.provider "bedrock") (eq model.provider "open_ai"))}}
|
|
17
|
+
{{#unless model.apiFormat}}
|
|
18
|
+
{{#if (eq model.provider "bedrock")}}
|
|
19
|
+
# apiFormat: converse_stream
|
|
20
|
+
{{else}}
|
|
21
|
+
# apiFormat: responses
|
|
22
|
+
{{/if}}
|
|
23
|
+
{{/unless}}
|
|
24
|
+
{{/if}}
|
|
25
|
+
{{#unless model.apiKeyArn}}
|
|
26
|
+
# apiKeyArn: YOUR_API_KEY_PROVIDER_ARN
|
|
27
|
+
{{/unless}}
|
|
28
|
+
|
|
29
|
+
# Edit system-prompt.md next to this file, or set inline instructions below to override it.
|
|
30
|
+
# systemPrompt: |
|
|
31
|
+
# You are a helpful assistant.
|
|
32
|
+
# Ask for clarification when a request is ambiguous.
|
|
33
|
+
|
|
34
|
+
# Remove this block or set mode to disabled to turn memory off.
|
|
35
|
+
# For existing memory, set mode to existing and add arn or name (for a memory in this project).
|
|
36
|
+
# https://docs.aws.amazon.com/bedrock-agentcore-control/latest/APIReference/API_HarnessMemoryConfiguration.html
|
|
37
|
+
{{yaml.memory}}
|
|
38
|
+
{{#if (eq memory.mode "managed")}}
|
|
39
|
+
{{#if memoryExamples.strategies}}
|
|
40
|
+
# strategies: [SEMANTIC, SUMMARIZATION, USER_PREFERENCE, EPISODIC]
|
|
41
|
+
{{/if}}
|
|
42
|
+
{{#if memoryExamples.eventExpiryDuration}}
|
|
43
|
+
# eventExpiryDuration: 30 # Days.
|
|
44
|
+
{{/if}}
|
|
45
|
+
{{/if}}
|
|
46
|
+
|
|
47
|
+
# Add tools alongside the harness's built-in shell and file operations.
|
|
48
|
+
# Choose a unique name for each entry.
|
|
49
|
+
# For Remote MCP, Gateway, Browser, Code Interpreter, and other tool configurations, see:
|
|
50
|
+
# https://docs.aws.amazon.com/bedrock-agentcore-control/latest/APIReference/API_HarnessTool.html
|
|
51
|
+
{{#if tools.length}}
|
|
52
|
+
{{yaml.tools}}
|
|
53
|
+
{{else}}
|
|
54
|
+
# tools:
|
|
55
|
+
# - name: research
|
|
56
|
+
# type: remote_mcp
|
|
57
|
+
# config:
|
|
58
|
+
# remoteMcp:
|
|
59
|
+
# url: https://mcp.example.com/mcp
|
|
60
|
+
{{/if}}
|
|
61
|
+
|
|
62
|
+
# Limit which available tools the agent can use. "*" allows all available tools.
|
|
63
|
+
# Restrict with patterns such as "@builtin".
|
|
64
|
+
# https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/harness-tools.html
|
|
65
|
+
{{#if yaml.allowedTools}}
|
|
66
|
+
{{yaml.allowedTools}}
|
|
67
|
+
{{else}}
|
|
68
|
+
allowedTools: ["*"]
|
|
69
|
+
{{/if}}
|
|
70
|
+
|
|
71
|
+
# Load skills from S3 (s3Uri), Git (gitUrl), container files (path), or bundled AWS skills (awsSkills).
|
|
72
|
+
# https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/harness-skills.html
|
|
73
|
+
{{yaml.skills}}
|
|
74
|
+
|
|
75
|
+
# Controls how conversation history is kept within the model's context window.
|
|
76
|
+
# https://docs.aws.amazon.com/bedrock-agentcore-control/latest/APIReference/API_HarnessTruncationConfiguration.html
|
|
77
|
+
{{#if yaml.truncation}}
|
|
78
|
+
{{yaml.truncation}}
|
|
79
|
+
{{#if (eq truncation.strategy "sliding_window")}}
|
|
80
|
+
{{#unless truncation.config}}
|
|
81
|
+
# config:
|
|
82
|
+
# slidingWindow:
|
|
83
|
+
# messagesCount: 40
|
|
84
|
+
{{/unless}}
|
|
85
|
+
{{/if}}
|
|
86
|
+
{{else}}
|
|
87
|
+
truncation:
|
|
88
|
+
strategy: sliding_window
|
|
89
|
+
# config:
|
|
90
|
+
# slidingWindow:
|
|
91
|
+
# messagesCount: 40
|
|
92
|
+
{{/if}}
|
|
93
|
+
|
|
94
|
+
# Limits for one invocation, across all model calls.
|
|
95
|
+
# https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/harness-operations.html#harness-limits
|
|
96
|
+
{{#if yaml.maxIterations}}
|
|
97
|
+
{{yaml.maxIterations}}
|
|
98
|
+
{{else}}
|
|
99
|
+
# maxIterations: 15
|
|
100
|
+
{{/if}}
|
|
101
|
+
{{#if yaml.maxTokens}}
|
|
102
|
+
{{yaml.maxTokens}}
|
|
103
|
+
{{else}}
|
|
104
|
+
# maxTokens: 20000
|
|
105
|
+
{{/if}}
|
|
106
|
+
{{#if yaml.timeoutSeconds}}
|
|
107
|
+
{{yaml.timeoutSeconds}}
|
|
108
|
+
{{else}}
|
|
109
|
+
# timeoutSeconds: 300
|
|
110
|
+
{{/if}}
|
|
111
|
+
|
|
112
|
+
# Values must be strings. Put quotes around numbers and booleans.
|
|
113
|
+
# Environment values are stored in plaintext.
|
|
114
|
+
# https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/harness-environment.html
|
|
115
|
+
{{#if yaml.environmentVariables}}
|
|
116
|
+
{{yaml.environmentVariables}}
|
|
117
|
+
{{else}}
|
|
118
|
+
environmentVariables: {}
|
|
119
|
+
{{/if}}
|
|
120
|
+
|
|
121
|
+
# Use a local Dockerfile or an ECR image. Omit both to use the service-provided environment.
|
|
122
|
+
# Dockerfile paths are relative to this file's directory.
|
|
123
|
+
# https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/harness-environment.html#harness-custom-container
|
|
124
|
+
{{#if yaml.dockerfile}}
|
|
125
|
+
{{yaml.dockerfile}}
|
|
126
|
+
{{else}}
|
|
127
|
+
# dockerfile: Dockerfile
|
|
128
|
+
{{/if}}
|
|
129
|
+
{{#if yaml.containerUri}}
|
|
130
|
+
{{yaml.containerUri}}
|
|
131
|
+
{{else}}
|
|
132
|
+
# containerUri: 123456789012.dkr.ecr.us-west-2.amazonaws.com/my-harness:latest
|
|
133
|
+
{{/if}}
|
|
134
|
+
|
|
135
|
+
# https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/harness-security.html#harness-network-config
|
|
136
|
+
{{#unless yaml.networkConfig}}
|
|
137
|
+
# To use the VPC example below, change networkMode to VPC and replace the resource IDs.
|
|
138
|
+
{{/unless}}
|
|
139
|
+
# vpcId is required for Dockerfile builds in VPC mode.
|
|
140
|
+
{{#if yaml.networkMode}}
|
|
141
|
+
{{yaml.networkMode}}
|
|
142
|
+
{{else}}
|
|
143
|
+
networkMode: PUBLIC
|
|
144
|
+
{{/if}}
|
|
145
|
+
{{#if yaml.networkConfig}}
|
|
146
|
+
{{yaml.networkConfig}}
|
|
147
|
+
{{else}}
|
|
148
|
+
# networkConfig:
|
|
149
|
+
# vpcId: vpc-0123456789abcdef0
|
|
150
|
+
# subnets: [subnet-0123456789abcdef0]
|
|
151
|
+
# securityGroups: [sg-0123456789abcdef0]
|
|
152
|
+
{{/if}}
|
|
153
|
+
|
|
154
|
+
# Caller authentication, separate from the credentials used to call models or tools.
|
|
155
|
+
# https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/harness-security.html
|
|
156
|
+
{{#unless yaml.authorizerConfiguration}}
|
|
157
|
+
# To use JWT, change authorizerType to CUSTOM_JWT and configure your identity provider below.
|
|
158
|
+
{{/unless}}
|
|
159
|
+
{{#if yaml.authorizerType}}
|
|
160
|
+
{{yaml.authorizerType}}
|
|
161
|
+
{{else}}
|
|
162
|
+
authorizerType: AWS_IAM
|
|
163
|
+
{{/if}}
|
|
164
|
+
{{#if yaml.authorizerConfiguration}}
|
|
165
|
+
{{yaml.authorizerConfiguration}}
|
|
166
|
+
{{else}}
|
|
167
|
+
# authorizerConfiguration:
|
|
168
|
+
# customJwtAuthorizer:
|
|
169
|
+
# discoveryUrl: https://id.example.com/.well-known/openid-configuration
|
|
170
|
+
# allowedAudience: [my-harness-app]
|
|
171
|
+
{{/if}}
|
|
172
|
+
|
|
173
|
+
# Deployment will create an execution role when omitted. Manage permissions yourself for a supplied role.
|
|
174
|
+
# https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/harness-security.html#harness-execution-role-policy
|
|
175
|
+
{{#if yaml.executionRoleArn}}
|
|
176
|
+
{{yaml.executionRoleArn}}
|
|
177
|
+
{{else}}
|
|
178
|
+
# executionRoleArn: arn:aws:iam::123456789012:role/MyHarnessRole
|
|
179
|
+
{{/if}}
|
|
180
|
+
|
|
181
|
+
# https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/harness-operations.html#harness-limits
|
|
182
|
+
{{#if yaml.lifecycleConfig}}
|
|
183
|
+
{{yaml.lifecycleConfig}}
|
|
184
|
+
{{else}}
|
|
185
|
+
# lifecycleConfig:
|
|
186
|
+
# idleRuntimeSessionTimeout: 900
|
|
187
|
+
# maxLifetime: 28800
|
|
188
|
+
{{/if}}
|
|
189
|
+
|
|
190
|
+
# https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/harness-environment.html
|
|
191
|
+
{{#if yaml.sessionStoragePath}}
|
|
192
|
+
{{yaml.sessionStoragePath}}
|
|
193
|
+
{{else}}
|
|
194
|
+
# sessionStoragePath: /mnt/session
|
|
195
|
+
{{/if}}
|
|
196
|
+
|
|
197
|
+
# EFS and S3 Files mounts require VPC mode. Each entry contains an accessPointArn and mountPath.
|
|
198
|
+
# Mount paths must be under /mnt and must be unique across all filesystem types.
|
|
199
|
+
{{#if yaml.efsAccessPoints}}
|
|
200
|
+
{{yaml.efsAccessPoints}}
|
|
201
|
+
{{else}}
|
|
202
|
+
efsAccessPoints: []
|
|
203
|
+
{{/if}}
|
|
204
|
+
{{#if yaml.s3AccessPoints}}
|
|
205
|
+
{{yaml.s3AccessPoints}}
|
|
206
|
+
{{else}}
|
|
207
|
+
s3AccessPoints: []
|
|
208
|
+
{{/if}}
|
|
209
|
+
|
|
210
|
+
{{#if yaml.connections}}
|
|
211
|
+
# Grant access to existing resources and expose their connection details as environment variables.
|
|
212
|
+
# This does not add agent tools; declare those under tools.
|
|
213
|
+
{{yaml.connections}}
|
|
214
|
+
|
|
215
|
+
{{/if}}
|
|
216
|
+
# https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/harness-operations.html
|
|
217
|
+
{{#if yaml.tags}}
|
|
218
|
+
{{yaml.tags}}
|
|
219
|
+
{{else}}
|
|
220
|
+
tags: {}
|
|
221
|
+
{{/if}}
|
|
222
|
+
{{#each additionalSettings}}
|
|
223
|
+
|
|
224
|
+
{{this}}
|
|
225
|
+
{{/each}}
|