bedrock-agentcore-starter-toolkit 0.0.1__py3-none-any.whl → 0.1.1__py3-none-any.whl
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.
Potentially problematic release.
This version of bedrock-agentcore-starter-toolkit might be problematic. Click here for more details.
- bedrock_agentcore_starter_toolkit/__init__.py +5 -0
- bedrock_agentcore_starter_toolkit/cli/cli.py +32 -0
- bedrock_agentcore_starter_toolkit/cli/common.py +44 -0
- bedrock_agentcore_starter_toolkit/cli/gateway/__init__.py +1 -0
- bedrock_agentcore_starter_toolkit/cli/gateway/commands.py +88 -0
- bedrock_agentcore_starter_toolkit/cli/runtime/__init__.py +1 -0
- bedrock_agentcore_starter_toolkit/cli/runtime/commands.py +651 -0
- bedrock_agentcore_starter_toolkit/cli/runtime/configuration_manager.py +133 -0
- bedrock_agentcore_starter_toolkit/notebook/__init__.py +5 -0
- bedrock_agentcore_starter_toolkit/notebook/runtime/__init__.py +1 -0
- bedrock_agentcore_starter_toolkit/notebook/runtime/bedrock_agentcore.py +239 -0
- bedrock_agentcore_starter_toolkit/operations/__init__.py +1 -0
- bedrock_agentcore_starter_toolkit/operations/gateway/README.md +277 -0
- bedrock_agentcore_starter_toolkit/operations/gateway/__init__.py +6 -0
- bedrock_agentcore_starter_toolkit/operations/gateway/client.py +456 -0
- bedrock_agentcore_starter_toolkit/operations/gateway/constants.py +152 -0
- bedrock_agentcore_starter_toolkit/operations/gateway/create_lambda.py +85 -0
- bedrock_agentcore_starter_toolkit/operations/gateway/create_role.py +90 -0
- bedrock_agentcore_starter_toolkit/operations/gateway/exceptions.py +13 -0
- bedrock_agentcore_starter_toolkit/operations/runtime/__init__.py +26 -0
- bedrock_agentcore_starter_toolkit/operations/runtime/configure.py +241 -0
- bedrock_agentcore_starter_toolkit/operations/runtime/create_role.py +404 -0
- bedrock_agentcore_starter_toolkit/operations/runtime/invoke.py +129 -0
- bedrock_agentcore_starter_toolkit/operations/runtime/launch.py +439 -0
- bedrock_agentcore_starter_toolkit/operations/runtime/models.py +79 -0
- bedrock_agentcore_starter_toolkit/operations/runtime/status.py +66 -0
- bedrock_agentcore_starter_toolkit/services/codebuild.py +332 -0
- bedrock_agentcore_starter_toolkit/services/ecr.py +84 -0
- bedrock_agentcore_starter_toolkit/services/runtime.py +473 -0
- bedrock_agentcore_starter_toolkit/utils/endpoints.py +32 -0
- bedrock_agentcore_starter_toolkit/utils/logging_config.py +72 -0
- bedrock_agentcore_starter_toolkit/utils/runtime/config.py +129 -0
- bedrock_agentcore_starter_toolkit/utils/runtime/container.py +310 -0
- bedrock_agentcore_starter_toolkit/utils/runtime/entrypoint.py +197 -0
- bedrock_agentcore_starter_toolkit/utils/runtime/logs.py +33 -0
- bedrock_agentcore_starter_toolkit/utils/runtime/policy_template.py +74 -0
- bedrock_agentcore_starter_toolkit/utils/runtime/schema.py +151 -0
- bedrock_agentcore_starter_toolkit/utils/runtime/templates/Dockerfile.j2 +44 -0
- bedrock_agentcore_starter_toolkit/utils/runtime/templates/dockerignore.template +68 -0
- bedrock_agentcore_starter_toolkit/utils/runtime/templates/execution_role_policy.json.j2 +98 -0
- bedrock_agentcore_starter_toolkit/utils/runtime/templates/execution_role_trust_policy.json.j2 +21 -0
- bedrock_agentcore_starter_toolkit-0.1.1.dist-info/METADATA +137 -0
- bedrock_agentcore_starter_toolkit-0.1.1.dist-info/RECORD +47 -0
- bedrock_agentcore_starter_toolkit-0.1.1.dist-info/entry_points.txt +2 -0
- bedrock_agentcore_starter_toolkit-0.1.1.dist-info/licenses/NOTICE.txt +190 -0
- bedrock_agentcore_starter_toolkit/init.py +0 -3
- bedrock_agentcore_starter_toolkit-0.0.1.dist-info/METADATA +0 -26
- bedrock_agentcore_starter_toolkit-0.0.1.dist-info/RECORD +0 -5
- {bedrock_agentcore_starter_toolkit-0.0.1.dist-info → bedrock_agentcore_starter_toolkit-0.1.1.dist-info}/WHEEL +0 -0
- /bedrock_agentcore_starter_toolkit-0.0.1.dist-info/licenses/LICENSE → /bedrock_agentcore_starter_toolkit-0.1.1.dist-info/licenses/LICENSE.txt +0 -0
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"""Policy template utilities for runtime execution roles."""
|
|
2
|
+
|
|
3
|
+
import json
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
from typing import Dict
|
|
6
|
+
|
|
7
|
+
from jinja2 import Environment, FileSystemLoader
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def _get_template_dir() -> Path:
|
|
11
|
+
"""Get the templates directory path."""
|
|
12
|
+
return Path(__file__).parent / "templates"
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def _render_template(template_name: str, variables: Dict[str, str]) -> str:
|
|
16
|
+
"""Render a Jinja2 template with the provided variables."""
|
|
17
|
+
template_dir = _get_template_dir()
|
|
18
|
+
env = Environment(loader=FileSystemLoader(template_dir), autoescape=True)
|
|
19
|
+
template = env.get_template(template_name)
|
|
20
|
+
return template.render(**variables)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def render_trust_policy_template(region: str, account_id: str) -> str:
|
|
24
|
+
"""Render the trust policy template with provided values.
|
|
25
|
+
|
|
26
|
+
Args:
|
|
27
|
+
region: AWS region
|
|
28
|
+
account_id: AWS account ID
|
|
29
|
+
|
|
30
|
+
Returns:
|
|
31
|
+
Rendered trust policy as JSON string
|
|
32
|
+
"""
|
|
33
|
+
variables = {
|
|
34
|
+
"region": region,
|
|
35
|
+
"account_id": account_id,
|
|
36
|
+
}
|
|
37
|
+
return _render_template("execution_role_trust_policy.json.j2", variables)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def render_execution_policy_template(region: str, account_id: str, agent_name: str) -> str:
|
|
41
|
+
"""Render the execution policy template with provided values.
|
|
42
|
+
|
|
43
|
+
Args:
|
|
44
|
+
region: AWS region
|
|
45
|
+
account_id: AWS account ID
|
|
46
|
+
agent_name: Agent name for resource scoping
|
|
47
|
+
|
|
48
|
+
Returns:
|
|
49
|
+
Rendered execution policy as JSON string
|
|
50
|
+
"""
|
|
51
|
+
variables = {
|
|
52
|
+
"region": region,
|
|
53
|
+
"account_id": account_id,
|
|
54
|
+
"agent_name": agent_name,
|
|
55
|
+
}
|
|
56
|
+
return _render_template("execution_role_policy.json.j2", variables)
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
def validate_rendered_policy(policy_json: str) -> Dict:
|
|
60
|
+
"""Validate that the rendered policy is valid JSON.
|
|
61
|
+
|
|
62
|
+
Args:
|
|
63
|
+
policy_json: JSON policy string
|
|
64
|
+
|
|
65
|
+
Returns:
|
|
66
|
+
Parsed policy dictionary
|
|
67
|
+
|
|
68
|
+
Raises:
|
|
69
|
+
ValueError: If policy JSON is invalid
|
|
70
|
+
"""
|
|
71
|
+
try:
|
|
72
|
+
return json.loads(policy_json)
|
|
73
|
+
except json.JSONDecodeError as e:
|
|
74
|
+
raise ValueError(f"Invalid policy JSON: {e}") from e
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
"""Typed configuration schema for Bedrock AgentCore SDK."""
|
|
2
|
+
|
|
3
|
+
from typing import Dict, List, Optional
|
|
4
|
+
|
|
5
|
+
from pydantic import BaseModel, Field, field_validator
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class NetworkConfiguration(BaseModel):
|
|
9
|
+
"""Network configuration for BedrockAgentCore deployment."""
|
|
10
|
+
|
|
11
|
+
network_mode: str = Field(default="PUBLIC", description="Network mode for deployment")
|
|
12
|
+
|
|
13
|
+
def to_aws_dict(self) -> dict:
|
|
14
|
+
"""Convert to AWS API format with camelCase keys."""
|
|
15
|
+
return {"networkMode": self.network_mode}
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class ProtocolConfiguration(BaseModel):
|
|
19
|
+
"""Protocol configuration for BedrockAgentCore deployment."""
|
|
20
|
+
|
|
21
|
+
server_protocol: str = Field(default="HTTP", description="Server protocol for deployment, either HTTP or MCP")
|
|
22
|
+
|
|
23
|
+
def to_aws_dict(self) -> dict:
|
|
24
|
+
"""Convert to AWS API format with camelCase keys."""
|
|
25
|
+
return {"serverProtocol": self.server_protocol}
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class ObservabilityConfig(BaseModel):
|
|
29
|
+
"""Observability configuration."""
|
|
30
|
+
|
|
31
|
+
enabled: bool = Field(default=True, description="Whether observability is enabled")
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
class AWSConfig(BaseModel):
|
|
35
|
+
"""AWS-specific configuration."""
|
|
36
|
+
|
|
37
|
+
execution_role: Optional[str] = Field(default=None, description="AWS IAM execution role ARN")
|
|
38
|
+
execution_role_auto_create: bool = Field(default=False, description="Whether to auto-create execution role")
|
|
39
|
+
account: Optional[str] = Field(default=None, description="AWS account ID")
|
|
40
|
+
region: Optional[str] = Field(default=None, description="AWS region")
|
|
41
|
+
ecr_repository: Optional[str] = Field(default=None, description="ECR repository URI")
|
|
42
|
+
ecr_auto_create: bool = Field(default=False, description="Whether to auto-create ECR repository")
|
|
43
|
+
network_configuration: NetworkConfiguration = Field(default_factory=NetworkConfiguration)
|
|
44
|
+
protocol_configuration: ProtocolConfiguration = Field(default_factory=ProtocolConfiguration)
|
|
45
|
+
observability: ObservabilityConfig = Field(default_factory=ObservabilityConfig)
|
|
46
|
+
|
|
47
|
+
@field_validator("account")
|
|
48
|
+
@classmethod
|
|
49
|
+
def validate_account(cls, v: Optional[str]) -> Optional[str]:
|
|
50
|
+
"""Validate AWS account ID."""
|
|
51
|
+
if v is not None:
|
|
52
|
+
if not v.isdigit() or len(v) != 12:
|
|
53
|
+
raise ValueError("Invalid AWS account ID")
|
|
54
|
+
return v
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
class CodeBuildConfig(BaseModel):
|
|
58
|
+
"""CodeBuild deployment information."""
|
|
59
|
+
|
|
60
|
+
project_name: Optional[str] = Field(default=None, description="CodeBuild project name")
|
|
61
|
+
execution_role: Optional[str] = Field(default=None, description="CodeBuild execution role ARN")
|
|
62
|
+
source_bucket: Optional[str] = Field(default=None, description="S3 source bucket name")
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
class BedrockAgentCoreDeploymentInfo(BaseModel):
|
|
66
|
+
"""BedrockAgentCore deployment information."""
|
|
67
|
+
|
|
68
|
+
agent_id: Optional[str] = Field(default=None, description="BedrockAgentCore agent ID")
|
|
69
|
+
agent_arn: Optional[str] = Field(default=None, description="BedrockAgentCore agent ARN")
|
|
70
|
+
agent_session_id: Optional[str] = Field(default=None, description="Session ID for invocations")
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
class BedrockAgentCoreAgentSchema(BaseModel):
|
|
74
|
+
"""Type-safe schema for BedrockAgentCore configuration."""
|
|
75
|
+
|
|
76
|
+
name: str = Field(..., description="Name of the Bedrock AgentCore application")
|
|
77
|
+
entrypoint: str = Field(..., description="Entrypoint file path")
|
|
78
|
+
platform: str = Field(default="linux/amd64", description="Target platform")
|
|
79
|
+
container_runtime: str = Field(default="docker", description="Container runtime to use")
|
|
80
|
+
aws: AWSConfig = Field(default_factory=AWSConfig)
|
|
81
|
+
bedrock_agentcore: BedrockAgentCoreDeploymentInfo = Field(default_factory=BedrockAgentCoreDeploymentInfo)
|
|
82
|
+
codebuild: CodeBuildConfig = Field(default_factory=CodeBuildConfig)
|
|
83
|
+
authorizer_configuration: Optional[dict] = Field(default=None, description="JWT authorizer configuration")
|
|
84
|
+
oauth_configuration: Optional[dict] = Field(default=None, description="Oauth configuration")
|
|
85
|
+
|
|
86
|
+
def get_authorizer_configuration(self) -> Optional[dict]:
|
|
87
|
+
"""Get the authorizer configuration."""
|
|
88
|
+
return self.authorizer_configuration
|
|
89
|
+
|
|
90
|
+
def validate(self, for_local: bool = False) -> List[str]:
|
|
91
|
+
"""Validate configuration and return list of errors.
|
|
92
|
+
|
|
93
|
+
Args:
|
|
94
|
+
for_local: Whether validating for local deployment
|
|
95
|
+
|
|
96
|
+
Returns:
|
|
97
|
+
List of validation error messages
|
|
98
|
+
"""
|
|
99
|
+
errors = []
|
|
100
|
+
|
|
101
|
+
# Required fields for all deployments
|
|
102
|
+
if not self.name:
|
|
103
|
+
errors.append("Missing 'name' field")
|
|
104
|
+
if not self.entrypoint:
|
|
105
|
+
errors.append("Missing 'entrypoint' field")
|
|
106
|
+
|
|
107
|
+
# AWS fields required for cloud deployment
|
|
108
|
+
if not for_local:
|
|
109
|
+
if not self.aws.execution_role and not self.aws.execution_role_auto_create:
|
|
110
|
+
errors.append("Missing 'aws.execution_role' for cloud deployment (or enable auto-creation)")
|
|
111
|
+
if not self.aws.region:
|
|
112
|
+
errors.append("Missing 'aws.region' for cloud deployment")
|
|
113
|
+
if not self.aws.account:
|
|
114
|
+
errors.append("Missing 'aws.account' for cloud deployment")
|
|
115
|
+
|
|
116
|
+
return errors
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
class BedrockAgentCoreConfigSchema(BaseModel):
|
|
120
|
+
"""Project configuration supporting multiple named agents.
|
|
121
|
+
|
|
122
|
+
Operations use --agent parameter to select which agent to work with.
|
|
123
|
+
"""
|
|
124
|
+
|
|
125
|
+
default_agent: Optional[str] = Field(default=None, description="Default agent name for operations")
|
|
126
|
+
agents: Dict[str, BedrockAgentCoreAgentSchema] = Field(
|
|
127
|
+
default_factory=dict, description="Named agent configurations"
|
|
128
|
+
)
|
|
129
|
+
|
|
130
|
+
def get_agent_config(self, agent_name: Optional[str] = None) -> BedrockAgentCoreAgentSchema:
|
|
131
|
+
"""Get agent config by name or default.
|
|
132
|
+
|
|
133
|
+
Args:
|
|
134
|
+
agent_name: Agent name from --agent parameter, or None for default
|
|
135
|
+
"""
|
|
136
|
+
target_name = agent_name or self.default_agent
|
|
137
|
+
if not target_name:
|
|
138
|
+
if len(self.agents) == 1:
|
|
139
|
+
agent = list(self.agents.values())[0]
|
|
140
|
+
self.default_agent = agent.name
|
|
141
|
+
return agent
|
|
142
|
+
raise ValueError("No agent specified and no default set")
|
|
143
|
+
|
|
144
|
+
if target_name not in self.agents:
|
|
145
|
+
available = list(self.agents.keys())
|
|
146
|
+
if available:
|
|
147
|
+
raise ValueError(f"Agent '{target_name}' not found. Available agents: {available}")
|
|
148
|
+
else:
|
|
149
|
+
raise ValueError("No agents configured")
|
|
150
|
+
|
|
151
|
+
return self.agents[target_name]
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
FROM public.ecr.aws/docker/library/python:{{ python_version }}-slim
|
|
2
|
+
WORKDIR /app
|
|
3
|
+
|
|
4
|
+
{% if dependencies_file %}
|
|
5
|
+
{% if dependencies_install_path %}
|
|
6
|
+
COPY {{ dependencies_install_path }} {{ dependencies_install_path }}
|
|
7
|
+
# Install from pyproject.toml directory
|
|
8
|
+
RUN pip install {{ dependencies_install_path }}
|
|
9
|
+
{% else %}
|
|
10
|
+
COPY {{ dependencies_file }} {{ dependencies_file }}
|
|
11
|
+
# Install from requirements file
|
|
12
|
+
RUN pip install -r {{ dependencies_file }}
|
|
13
|
+
{% endif %}
|
|
14
|
+
{% endif %}
|
|
15
|
+
|
|
16
|
+
{% if observability_enabled %}
|
|
17
|
+
RUN pip install aws-opentelemetry-distro>=0.10.0
|
|
18
|
+
{% endif %}
|
|
19
|
+
|
|
20
|
+
# Set AWS region environment variable
|
|
21
|
+
{% if aws_region %}
|
|
22
|
+
ENV AWS_REGION={{ aws_region }}
|
|
23
|
+
ENV AWS_DEFAULT_REGION={{ aws_region }}
|
|
24
|
+
{% endif %}
|
|
25
|
+
|
|
26
|
+
# Signal that this is running in Docker for host binding logic
|
|
27
|
+
ENV DOCKER_CONTAINER=1
|
|
28
|
+
|
|
29
|
+
# Create non-root user
|
|
30
|
+
RUN useradd -m -u 1000 bedrock_agentcore
|
|
31
|
+
USER bedrock_agentcore
|
|
32
|
+
|
|
33
|
+
EXPOSE 8080
|
|
34
|
+
EXPOSE 8000
|
|
35
|
+
|
|
36
|
+
# Copy entire project (respecting .dockerignore)
|
|
37
|
+
COPY . .
|
|
38
|
+
|
|
39
|
+
# Use the full module path
|
|
40
|
+
{% if observability_enabled %}
|
|
41
|
+
CMD ["opentelemetry-instrument", "python", "-m", "{{ agent_module_path }}"]
|
|
42
|
+
{% else %}
|
|
43
|
+
CMD ["python", "-m", "{{ agent_module_path }}"]
|
|
44
|
+
{% endif %}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# Build artifacts
|
|
2
|
+
build/
|
|
3
|
+
dist/
|
|
4
|
+
*.egg-info/
|
|
5
|
+
*.egg
|
|
6
|
+
|
|
7
|
+
# Python cache
|
|
8
|
+
__pycache__/
|
|
9
|
+
__pycache__*
|
|
10
|
+
*.py[cod]
|
|
11
|
+
*$py.class
|
|
12
|
+
*.so
|
|
13
|
+
.Python
|
|
14
|
+
|
|
15
|
+
# Virtual environments
|
|
16
|
+
.venv/
|
|
17
|
+
.env
|
|
18
|
+
venv/
|
|
19
|
+
env/
|
|
20
|
+
ENV/
|
|
21
|
+
|
|
22
|
+
# Testing
|
|
23
|
+
.pytest_cache/
|
|
24
|
+
.coverage
|
|
25
|
+
.coverage*
|
|
26
|
+
htmlcov/
|
|
27
|
+
.tox/
|
|
28
|
+
*.cover
|
|
29
|
+
.hypothesis/
|
|
30
|
+
.mypy_cache/
|
|
31
|
+
.ruff_cache/
|
|
32
|
+
|
|
33
|
+
# Development
|
|
34
|
+
*.log
|
|
35
|
+
*.bak
|
|
36
|
+
*.swp
|
|
37
|
+
*.swo
|
|
38
|
+
*~
|
|
39
|
+
.DS_Store
|
|
40
|
+
|
|
41
|
+
# IDEs
|
|
42
|
+
.vscode/
|
|
43
|
+
.idea/
|
|
44
|
+
|
|
45
|
+
# Version control
|
|
46
|
+
.git/
|
|
47
|
+
.gitignore
|
|
48
|
+
.gitattributes
|
|
49
|
+
|
|
50
|
+
# Documentation
|
|
51
|
+
docs/
|
|
52
|
+
*.md
|
|
53
|
+
!README.md
|
|
54
|
+
|
|
55
|
+
# CI/CD
|
|
56
|
+
.github/
|
|
57
|
+
.gitlab-ci.yml
|
|
58
|
+
.travis.yml
|
|
59
|
+
|
|
60
|
+
# Project specific
|
|
61
|
+
tests/
|
|
62
|
+
|
|
63
|
+
# Bedrock AgentCore specific - keep config but exclude runtime files
|
|
64
|
+
.bedrock_agentcore.yaml
|
|
65
|
+
.dockerignore
|
|
66
|
+
|
|
67
|
+
# Keep wheelhouse for offline installations
|
|
68
|
+
# wheelhouse/
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Version": "2012-10-17",
|
|
3
|
+
"Statement": [
|
|
4
|
+
{
|
|
5
|
+
"Sid": "ECRImageAccess",
|
|
6
|
+
"Effect": "Allow",
|
|
7
|
+
"Action": [
|
|
8
|
+
"ecr:BatchGetImage",
|
|
9
|
+
"ecr:GetDownloadUrlForLayer"
|
|
10
|
+
],
|
|
11
|
+
"Resource": [
|
|
12
|
+
"arn:aws:ecr:{{ region }}:{{ account_id }}:repository/*"
|
|
13
|
+
]
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"Effect": "Allow",
|
|
17
|
+
"Action": [
|
|
18
|
+
"logs:DescribeLogStreams",
|
|
19
|
+
"logs:CreateLogGroup"
|
|
20
|
+
],
|
|
21
|
+
"Resource": [
|
|
22
|
+
"arn:aws:logs:{{ region }}:{{ account_id }}:log-group:/aws/bedrock-agentcore/runtimes/*"
|
|
23
|
+
]
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"Effect": "Allow",
|
|
27
|
+
"Action": [
|
|
28
|
+
"logs:DescribeLogGroups"
|
|
29
|
+
],
|
|
30
|
+
"Resource": [
|
|
31
|
+
"arn:aws:logs:{{ region }}:{{ account_id }}:log-group:*"
|
|
32
|
+
]
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"Effect": "Allow",
|
|
36
|
+
"Action": [
|
|
37
|
+
"logs:CreateLogStream",
|
|
38
|
+
"logs:PutLogEvents"
|
|
39
|
+
],
|
|
40
|
+
"Resource": [
|
|
41
|
+
"arn:aws:logs:{{ region }}:{{ account_id }}:log-group:/aws/bedrock-agentcore/runtimes/*:log-stream:*"
|
|
42
|
+
]
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"Sid": "ECRTokenAccess",
|
|
46
|
+
"Effect": "Allow",
|
|
47
|
+
"Action": [
|
|
48
|
+
"ecr:GetAuthorizationToken"
|
|
49
|
+
],
|
|
50
|
+
"Resource": "*"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"Effect": "Allow",
|
|
54
|
+
"Action": [
|
|
55
|
+
"xray:PutTraceSegments",
|
|
56
|
+
"xray:PutTelemetryRecords",
|
|
57
|
+
"xray:GetSamplingRules",
|
|
58
|
+
"xray:GetSamplingTargets"
|
|
59
|
+
],
|
|
60
|
+
"Resource": ["*"]
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"Effect": "Allow",
|
|
64
|
+
"Resource": "*",
|
|
65
|
+
"Action": "cloudwatch:PutMetricData",
|
|
66
|
+
"Condition": {
|
|
67
|
+
"StringEquals": {
|
|
68
|
+
"cloudwatch:namespace": "bedrock-agentcore"
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"Sid": "GetAgentAccessToken",
|
|
74
|
+
"Effect": "Allow",
|
|
75
|
+
"Action": [
|
|
76
|
+
"bedrock-agentcore:GetWorkloadAccessToken",
|
|
77
|
+
"bedrock-agentcore:GetWorkloadAccessTokenForJWT",
|
|
78
|
+
"bedrock-agentcore:GetWorkloadAccessTokenForUserId"
|
|
79
|
+
],
|
|
80
|
+
"Resource": [
|
|
81
|
+
"arn:aws:bedrock-agentcore:{{ region }}:{{ account_id }}:workload-identity-directory/default",
|
|
82
|
+
"arn:aws:bedrock-agentcore:{{ region }}:{{ account_id }}:workload-identity-directory/default/workload-identity/{{ agent_name }}-*"
|
|
83
|
+
]
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"Sid": "BedrockModelInvocation",
|
|
87
|
+
"Effect": "Allow",
|
|
88
|
+
"Action": [
|
|
89
|
+
"bedrock:InvokeModel",
|
|
90
|
+
"bedrock:InvokeModelWithResponseStream"
|
|
91
|
+
],
|
|
92
|
+
"Resource": [
|
|
93
|
+
"arn:aws:bedrock:*::foundation-model/*",
|
|
94
|
+
"arn:aws:bedrock:{{ region }}:{{ account_id }}:*"
|
|
95
|
+
]
|
|
96
|
+
}
|
|
97
|
+
]
|
|
98
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Version": "2012-10-17",
|
|
3
|
+
"Statement": [
|
|
4
|
+
{
|
|
5
|
+
"Sid": "AssumeRolePolicy",
|
|
6
|
+
"Effect": "Allow",
|
|
7
|
+
"Principal": {
|
|
8
|
+
"Service": "bedrock-agentcore.amazonaws.com"
|
|
9
|
+
},
|
|
10
|
+
"Action": "sts:AssumeRole",
|
|
11
|
+
"Condition": {
|
|
12
|
+
"StringEquals": {
|
|
13
|
+
"aws:SourceAccount": "{{ account_id }}"
|
|
14
|
+
},
|
|
15
|
+
"ArnLike": {
|
|
16
|
+
"aws:SourceArn": "arn:aws:bedrock-agentcore:{{ region }}:{{ account_id }}:*"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
]
|
|
21
|
+
}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: bedrock-agentcore-starter-toolkit
|
|
3
|
+
Version: 0.1.1
|
|
4
|
+
Summary: A starter toolkit for using Bedrock AgentCore
|
|
5
|
+
Project-URL: Homepage, https://github.com/aws/bedrock-agentcore-starter-toolkit
|
|
6
|
+
Project-URL: Bug Tracker, https://github.com/aws/bedrock-agentcore-starter-toolkit/issues
|
|
7
|
+
Project-URL: Documentation, https://github.com/aws/bedrock-agentcore-starter-toolkit
|
|
8
|
+
Author-email: AWS <opensource@amazon.com>
|
|
9
|
+
License: Apache-2.0
|
|
10
|
+
License-File: LICENSE.txt
|
|
11
|
+
License-File: NOTICE.txt
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
15
|
+
Classifier: Operating System :: OS Independent
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
21
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
22
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
23
|
+
Requires-Python: >=3.10
|
|
24
|
+
Requires-Dist: bedrock-agentcore>=0.1.0
|
|
25
|
+
Requires-Dist: boto3>=1.39.7
|
|
26
|
+
Requires-Dist: botocore>=1.39.7
|
|
27
|
+
Requires-Dist: docstring-parser<1.0,>=0.15
|
|
28
|
+
Requires-Dist: httpx>=0.28.1
|
|
29
|
+
Requires-Dist: jinja2>=3.1.6
|
|
30
|
+
Requires-Dist: prompt-toolkit>=3.0.51
|
|
31
|
+
Requires-Dist: pydantic<3.0.0,>=2.0.0
|
|
32
|
+
Requires-Dist: pyyaml>=6.0.2
|
|
33
|
+
Requires-Dist: requests>=2.25.0
|
|
34
|
+
Requires-Dist: rich<15.0.0,>=14.0.0
|
|
35
|
+
Requires-Dist: toml>=0.10.2
|
|
36
|
+
Requires-Dist: typer>=0.16.0
|
|
37
|
+
Requires-Dist: typing-extensions<5.0.0,>=4.13.2
|
|
38
|
+
Requires-Dist: urllib3>=1.26.0
|
|
39
|
+
Requires-Dist: uvicorn>=0.34.2
|
|
40
|
+
Description-Content-Type: text/markdown
|
|
41
|
+
|
|
42
|
+
<div align="center">
|
|
43
|
+
<h1>
|
|
44
|
+
Bedrock AgentCore Starter Toolkit
|
|
45
|
+
</h1>
|
|
46
|
+
|
|
47
|
+
<h2>
|
|
48
|
+
Deploy your local AI agent to Bedrock AgentCore with zero infrastructure
|
|
49
|
+
</h2>
|
|
50
|
+
|
|
51
|
+
<div align="center">
|
|
52
|
+
<a href="https://github.com/aws/bedrock-agentcore-starter-toolkit/graphs/commit-activity"><img alt="GitHub commit activity" src="https://img.shields.io/github/commit-activity/m/aws/bedrock-agentcore-starter-toolkit"/></a>
|
|
53
|
+
<a href="https://github.com/aws/bedrock-agentcore-starter-toolkit/issues"><img alt="GitHub open issues" src="https://img.shields.io/github/issues/aws/bedrock-agentcore-starter-toolkit"/></a>
|
|
54
|
+
<a href="https://github.com/aws/bedrock-agentcore-starter-toolkit/pulls"><img alt="GitHub open pull requests" src="https://img.shields.io/github/issues-pr/aws/bedrock-agentcore-starter-toolkit"/></a>
|
|
55
|
+
<a href="https://github.com/aws/bedrock-agentcore-starter-toolkit/blob/main/LICENSE.txt"><img alt="License" src="https://img.shields.io/github/license/aws/bedrock-agentcore-starter-toolkit"/></a>
|
|
56
|
+
<a href="https://pypi.org/project/bedrock-agentcore-starter-toolkit"><img alt="PyPI version" src="https://img.shields.io/pypi/v/bedrock-agentcore-starter-toolkit"/></a>
|
|
57
|
+
<a href="https://python.org"><img alt="Python versions" src="https://img.shields.io/pypi/pyversions/bedrock-agentcore-starter-toolkit"/></a>
|
|
58
|
+
</div>
|
|
59
|
+
|
|
60
|
+
<p>
|
|
61
|
+
<a href="https://github.com/aws/bedrock-agentcore-sdk-python">Python SDK</a>
|
|
62
|
+
◆ <a href="https://github.com/aws/bedrock-agentcore-starter-toolkit">Starter Toolkit</a>
|
|
63
|
+
◆ <a href="https://github.com/awslabs/amazon-bedrock-agentcore-samples">Samples</a>
|
|
64
|
+
◆ <a href="https://discord.gg/bedrockagentcore-preview">Discord</a>
|
|
65
|
+
</p>
|
|
66
|
+
</div>
|
|
67
|
+
|
|
68
|
+
## 🚀 From Local Development to Bedrock AgentCore
|
|
69
|
+
|
|
70
|
+
```python
|
|
71
|
+
# Build your agent with the SDK
|
|
72
|
+
from bedrock_agentcore import BedrockAgentCoreApp
|
|
73
|
+
|
|
74
|
+
app = BedrockAgentCoreApp()
|
|
75
|
+
|
|
76
|
+
@app.entrypoint
|
|
77
|
+
def my_agent(request):
|
|
78
|
+
# Your existing Strands, LangGraph, CrewAI, or custom agent logic
|
|
79
|
+
return process_with_your_framework(request.get("prompt"))
|
|
80
|
+
|
|
81
|
+
app.run()
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
# Deploy with the Starter Toolkit
|
|
86
|
+
agentcore configure --entrypoint my_agent.py
|
|
87
|
+
agentcore launch # Ready to run on Bedrock AgentCore
|
|
88
|
+
agentcore invoke '{"prompt": "tell me a fact"}'
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
**What you get with the Starter Toolkit:**
|
|
92
|
+
- ✅ **Keep your agent logic** - Works with any SDK-built agent
|
|
93
|
+
- ✅ **Zero infrastructure management** - No servers, containers, or scaling concerns
|
|
94
|
+
- ✅ **One-command deployment** - From local development to enterprise platform
|
|
95
|
+
- ✅ **Production-ready hosting** - Reliable, scalable, compliant Bedrock AgentCore deployment
|
|
96
|
+
|
|
97
|
+
## ⚠️ Preview Status
|
|
98
|
+
|
|
99
|
+
Bedrock AgentCore Starter Toolkit is currently in public preview. APIs may change as we refine the SDK.
|
|
100
|
+
|
|
101
|
+
## 🛠️ Deployment & Management Tools
|
|
102
|
+
|
|
103
|
+
**Simple Configuration**
|
|
104
|
+
```bash
|
|
105
|
+
# Configure your agent for deployment
|
|
106
|
+
agentcore configure --entrypoint my_agent.py --name my-production-agent
|
|
107
|
+
|
|
108
|
+
# Check deployment status
|
|
109
|
+
agentcore status
|
|
110
|
+
|
|
111
|
+
# Invoke your deployed agent
|
|
112
|
+
agentcore invoke '{"prompt": "Hello from Bedrock AgentCore!"}'
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
**Enterprise Platform Services**
|
|
116
|
+
- 🚀 **Runtime** - Serverless deployment and scaling with fast cold starts
|
|
117
|
+
- 🧠 **Memory** - Persistent knowledge with event and semantic memory
|
|
118
|
+
- 🔗 **Gateway** - Transform existing APIs and Lambda functions into MCP tools
|
|
119
|
+
- 🔐 **Identity** - Secure authentication and access management
|
|
120
|
+
- 💻 **Code Interpreter** - Secure code execution in isolated sandbox environments
|
|
121
|
+
- 🌐 **Browser** - Fast, secure cloud-based browser for web automation
|
|
122
|
+
- 📊 **Observability** - Real-time monitoring and tracing with OpenTelemetry support
|
|
123
|
+
|
|
124
|
+
## 📚 About Amazon Bedrock AgentCore
|
|
125
|
+
|
|
126
|
+
Amazon Bedrock AgentCore enables you to deploy and operate highly effective agents securely, at scale using any framework and model. With AgentCore, developers can accelerate AI agents into production with enterprise-grade scale, reliability, and security. The platform provides:
|
|
127
|
+
|
|
128
|
+
- **Composable Services**: Mix and match services to fit your needs
|
|
129
|
+
- **Framework Flexibility**: Works with Strands, LangGraph, CrewAI, Strands, and more
|
|
130
|
+
- **Any Model Support**: Not locked into specific models
|
|
131
|
+
- **Enterprise Security**: Built-in identity, isolation, and access controls
|
|
132
|
+
|
|
133
|
+
## 📝 License & Contributing
|
|
134
|
+
|
|
135
|
+
- **License:** Apache 2.0 - see [LICENSE.txt](LICENSE.txt)
|
|
136
|
+
- **Contributing:** See [CONTRIBUTING.md](CONTRIBUTING.md)
|
|
137
|
+
- **Security:** Report vulnerabilities via [SECURITY.md](SECURITY.md)
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
bedrock_agentcore_starter_toolkit/__init__.py,sha256=tN3-JWKvxk4ZSJQJIHQ4mMsDtt8J_cDCz-drcGU9USA,120
|
|
2
|
+
bedrock_agentcore_starter_toolkit/cli/cli.py,sha256=cZ9rQ5i46kq38W3U4HxWH6zKQGWl0nUZkUB6UHu19Bw,850
|
|
3
|
+
bedrock_agentcore_starter_toolkit/cli/common.py,sha256=eVjxsQQC4RjvyZouRBTUBPjoWDSE4yQ6q9Mi6WsuDrc,1315
|
|
4
|
+
bedrock_agentcore_starter_toolkit/cli/gateway/__init__.py,sha256=8IZ0kSe6Kz5s2j-SBsoc6qy04MbK85RMTQwZCiR2wmo,68
|
|
5
|
+
bedrock_agentcore_starter_toolkit/cli/gateway/commands.py,sha256=3DuXCvqXlmHU2cmjGzDruyc2Fkrpgoi158myj0vc3nA,3265
|
|
6
|
+
bedrock_agentcore_starter_toolkit/cli/runtime/__init__.py,sha256=0zKPPoYThoDIr3DZhIQJavq5nVTKRsgcE1s9--wx118,60
|
|
7
|
+
bedrock_agentcore_starter_toolkit/cli/runtime/commands.py,sha256=LgErKPNHXqBavdz8Bqngc90tUEBSZg4V2oClqAw1G4w,28422
|
|
8
|
+
bedrock_agentcore_starter_toolkit/cli/runtime/configuration_manager.py,sha256=5TJK80uzA1ARh263smLfthw1t5Ona3bAtdO1pE7OfNo,5808
|
|
9
|
+
bedrock_agentcore_starter_toolkit/notebook/__init__.py,sha256=wH1ZzIVKsKT_P0qX2kIIoyVxeHj8K40odfR1YI3McHw,129
|
|
10
|
+
bedrock_agentcore_starter_toolkit/notebook/runtime/__init__.py,sha256=DoGfB_uGFLANJVE9rSZtTH3ymw76WBWmD9vORvBIdXs,66
|
|
11
|
+
bedrock_agentcore_starter_toolkit/notebook/runtime/bedrock_agentcore.py,sha256=ep-NVyzjHJfPRhVeuJxpcIbg8FEYHMFF4BwudurjBe0,9738
|
|
12
|
+
bedrock_agentcore_starter_toolkit/operations/__init__.py,sha256=L7sCNjfZviiVVoh2f3NEs2sbjNqFkmIRI3ZPYMMWMz0,51
|
|
13
|
+
bedrock_agentcore_starter_toolkit/operations/gateway/README.md,sha256=aJla3qAaZmM0b4t9q4lQYqfamAugU0FyyzsufFMRi_A,8192
|
|
14
|
+
bedrock_agentcore_starter_toolkit/operations/gateway/__init__.py,sha256=5Qo1GeN-DghNp9g0coFUs7WpUJDboJoidOVs-5Co7fo,233
|
|
15
|
+
bedrock_agentcore_starter_toolkit/operations/gateway/client.py,sha256=0Jot4RkhrM2nVKEEcOQH4ThkaXuR4UaHaVXD8vxpEpA,20030
|
|
16
|
+
bedrock_agentcore_starter_toolkit/operations/gateway/constants.py,sha256=0_4J6BN4VAE4-XTQhPTEACkhilRrFqu_iKiuHSm2pYk,4610
|
|
17
|
+
bedrock_agentcore_starter_toolkit/operations/gateway/create_lambda.py,sha256=MQsBJfUj26zBh7LqYWLoekHuvbAHIJE8qcXwrmJOhM0,2875
|
|
18
|
+
bedrock_agentcore_starter_toolkit/operations/gateway/create_role.py,sha256=a38JE28PbdRabskTgLXsiqHqWS1vt06jxEEGneYPO_g,3145
|
|
19
|
+
bedrock_agentcore_starter_toolkit/operations/gateway/exceptions.py,sha256=WjsrE7lT2708CJniM_ISMzkfNX4IUteGgvOxleD9JZY,272
|
|
20
|
+
bedrock_agentcore_starter_toolkit/operations/runtime/__init__.py,sha256=7ucAtIbabrDmEaHOfGqHtEr2CkQlEsb5O2tkHirXCqU,673
|
|
21
|
+
bedrock_agentcore_starter_toolkit/operations/runtime/configure.py,sha256=BIvFX5EF73X8VNOKQThsyYSWTWLDUkM4di8HW1MGVe8,8948
|
|
22
|
+
bedrock_agentcore_starter_toolkit/operations/runtime/create_role.py,sha256=5-BL_EA1LFy6vSTl5Rppj1et7Y0tuaB8C9-Ze4ESt1A,15952
|
|
23
|
+
bedrock_agentcore_starter_toolkit/operations/runtime/invoke.py,sha256=klDICZq-EHcxDjJhb1oVa7-vuFUvq5-HioqWrk__H_E,4539
|
|
24
|
+
bedrock_agentcore_starter_toolkit/operations/runtime/launch.py,sha256=6zOt6BEd4rcQz57WIH9MtOqCBN0FEUfp7B68gjXV3jk,15940
|
|
25
|
+
bedrock_agentcore_starter_toolkit/operations/runtime/models.py,sha256=6xzNOTSeJj-9kXQKWOGECrBbYopHNNrZfUBsEvl1fNg,3683
|
|
26
|
+
bedrock_agentcore_starter_toolkit/operations/runtime/status.py,sha256=tpOtzAq1S3z_7baxR_WOT8Avo3MtWKGpelVOOfb-uMA,2516
|
|
27
|
+
bedrock_agentcore_starter_toolkit/services/codebuild.py,sha256=gVYi8CKQwcpt567-qe1-GN5l3n0q3DSlU_dFwlBfy_4,13282
|
|
28
|
+
bedrock_agentcore_starter_toolkit/services/ecr.py,sha256=nW9wIZcXI6amZeLVSmM9F6awVBQP1-zrFXTozSNEDjo,2805
|
|
29
|
+
bedrock_agentcore_starter_toolkit/services/runtime.py,sha256=qL1kk3PL-e7ivArFbVdKyf9PKIPyor2hRdI7rc_Bmws,17214
|
|
30
|
+
bedrock_agentcore_starter_toolkit/utils/endpoints.py,sha256=1gIDRd1oO1fymYpiedVit7m6zl5k6N8Ns9N-2ix7ZaE,1153
|
|
31
|
+
bedrock_agentcore_starter_toolkit/utils/logging_config.py,sha256=NtZDyndNKCAbz7jZ0leb13bb3UmjjRUTSVwI8MMlOfw,2191
|
|
32
|
+
bedrock_agentcore_starter_toolkit/utils/runtime/config.py,sha256=qRQid59rD3zJ0d0hcBY4-8R52PNIWEIUt9iR3biuz_c,4495
|
|
33
|
+
bedrock_agentcore_starter_toolkit/utils/runtime/container.py,sha256=6mYVA1YOTTWowBtCNdheLWTH1qL7t7Fd3ogloLIuvxQ,12829
|
|
34
|
+
bedrock_agentcore_starter_toolkit/utils/runtime/entrypoint.py,sha256=FSZskJc0iZ27RsVbiL5-CYUi1fYdvIxVXUlR1IyvgiU,7144
|
|
35
|
+
bedrock_agentcore_starter_toolkit/utils/runtime/logs.py,sha256=RUP5W2rbkXf33Kis4MnaI8xIjkpidO1at3kiXmxAw0I,1082
|
|
36
|
+
bedrock_agentcore_starter_toolkit/utils/runtime/policy_template.py,sha256=CgER7YXPh0BpR6JcTcumDL_k8bhmfLSEok1sf09-31I,2054
|
|
37
|
+
bedrock_agentcore_starter_toolkit/utils/runtime/schema.py,sha256=gZ0zPvry-ZkXwqUEAy6Izz1RJvmZaXA6a2twnSdk1AY,6418
|
|
38
|
+
bedrock_agentcore_starter_toolkit/utils/runtime/templates/Dockerfile.j2,sha256=ti33aLVoqSfdbBUohxSK-ad1Qb_h7AoO_bkFcgik4UA,1166
|
|
39
|
+
bedrock_agentcore_starter_toolkit/utils/runtime/templates/dockerignore.template,sha256=b_70sBi0MwkTuA9TqxPqFcWK7TcmpaXBJ6M2Ipox65Q,691
|
|
40
|
+
bedrock_agentcore_starter_toolkit/utils/runtime/templates/execution_role_policy.json.j2,sha256=eFPp6sl7TS7p_FSdCqSMkXNZnDg-ahg9rhufT71A0SQ,2477
|
|
41
|
+
bedrock_agentcore_starter_toolkit/utils/runtime/templates/execution_role_trust_policy.json.j2,sha256=PPJF6Ofq70W5DUE0NlbmnZjw5RkgepPgkskxEgEG28o,473
|
|
42
|
+
bedrock_agentcore_starter_toolkit-0.1.1.dist-info/METADATA,sha256=7JZNYKxrMiGvKEtScwBnwGr3Du-MElHjtlUTHU8TKzI,6198
|
|
43
|
+
bedrock_agentcore_starter_toolkit-0.1.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
44
|
+
bedrock_agentcore_starter_toolkit-0.1.1.dist-info/entry_points.txt,sha256=Tf94DkUf2Tp8P7p8MEXLxre7A7Pp_XNukteiz0wHnk8,77
|
|
45
|
+
bedrock_agentcore_starter_toolkit-0.1.1.dist-info/licenses/LICENSE.txt,sha256=nNPOMinitYdtfbhdQgsPgz1UowBznU6QVN3Xs0pSTKU,10768
|
|
46
|
+
bedrock_agentcore_starter_toolkit-0.1.1.dist-info/licenses/NOTICE.txt,sha256=rkBsg8DbKqfIoQbveqX9foR4uJPUVAokbkr02pRPilE,8674
|
|
47
|
+
bedrock_agentcore_starter_toolkit-0.1.1.dist-info/RECORD,,
|