AWS CDK construct library for deploying Bedrock AgentCore Runtime
Project description
Simple AgentCore Runtime Patterns
An AWS CDK construct library for deploying AWS Bedrock AgentCore runtimes.
This library helps you deploy containerized AI agents to AWS Bedrock AgentCore using AWS CDK. It handles Docker image building, ECR deployment, IAM roles, and runtime configuration automatically.
Installation
TypeScript / JavaScript
npm install simple-agentcore-runtime-patterns
Python
pip install simple-agentcore-runtime-patterns
Quick Start
Prerequisites
- AWS CDK installed (
npm install -g aws-cdk) - Docker installed and running
- Your agent code in a directory with a
Dockerfile
TypeScript Example
import { SimpleAgentCoreRuntime } from 'simple-agentcore-runtime-patterns';
import { App, Stack } from 'aws-cdk-lib';
const app = new App();
const stack = new Stack(app, 'MyStack');
new SimpleAgentCoreRuntime(stack, 'MyAgent', {
agentName: 'my_bedrock_agent', // Required: snake_case, max 40 chars
agentSrcPath: './my-agent-code', // Required: path to your agent code
});
app.synth();
Python Example
from simple_agentcore_runtime_patterns import SimpleAgentCoreRuntime
from aws_cdk import App, Stack
app = App()
stack = Stack(app, "MyStack")
SimpleAgentCoreRuntime(stack, "MyAgent",
agent_name="my_bedrock_agent", # Required: snake_case, max 40 chars
agent_src_path="./my-agent-code", # Required: path to your agent code
)
app.synth()
Architecture
Input Properties Outputs
───────────────── ───────
• agentName • runtimeId
• agentSrcPath ┌────────────────────────────────────────────┐ • runtimeVersion
───▶│ SimpleAgentCoreRuntime Construct │────▶• runtimeArn
│ │ • runtimeExecutionRole
│ ┌──────────────────────────────────────┐ │
│ │ IAM Role │ │
│ │ (AgentCoreRuntimeExecutionRole) │ │
│ │ • ECR access │ │
│ │ • CloudWatch Logs │ │
│ │ • Bedrock model invocation │ │
│ └──────────────────┬───────────────────┘ │
│ │ │
│ ┌──────────────────▼───────────────────┐ │
Docker Image ────────┼─▶│ ECR Repository │ │
(from agentSrcPath) │ │ • Stores container image │ │
│ │ • Tag: latest │ │
│ └──────────────────┬───────────────────┘ │
│ │ │
│ ┌──────────────────▼───────────────────┐ │
│ │ Bedrock AgentCore Runtime │ │
│ │ • Runs your agent container │ │
│ │ • Network: PUBLIC (default) │ │
│ │ • Environment variables │ │
│ └──────────────────────────────────────┘ │
│ │
└────────────────────────────────────────────┘
│
│ checks & creates if needed
▼
┌────────────────────────────────────────────┐
│ Service-Linked Roles (Outside Construct) │
│ • Network SLR │
│ • Runtime Identity SLR │
└────────────────────────────────────────────┘
Configuration Options
Required Properties
| Property | Type | Description |
|---|---|---|
agentName |
string | Name of your agent (snake_case, lowercase, numbers, underscores only, max 40 characters) |
agentSrcPath |
string | Path to directory containing your agent code and Dockerfile |
Optional Properties
| Property | Type | Default | Description |
|---|---|---|---|
ecrRepositoryName |
string | Creates new repository | ECR repository name for container image |
runtimeExecutionRole |
IAM Role | Creates new role | IAM role for runtime execution |
networkConfiguration |
object | { networkMode: 'PUBLIC' } |
Network settings for the runtime |
environmentVariables |
object | None | Environment variables for your agent container |
agentDescription |
string | None | Description of your agent |
Documentation
- API Documentation - Complete API reference
- AGENTS.md - Guide for AI coding assistants
Requirements
- AWS CDK v2.221.0 or later
- Node.js 22 or later
- Docker (for building container images)
License
MIT-0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file simple_agentcore_runtime_patterns-0.0.0.tar.gz.
File metadata
- Download URL: simple_agentcore_runtime_patterns-0.0.0.tar.gz
- Upload date:
- Size: 41.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3a1168e5cdf3265081a14dcd6c0f3b35c2413add416fb4097e94bc6c6529d929
|
|
| MD5 |
06ed4c44715eeb921477ff7566cca2e1
|
|
| BLAKE2b-256 |
03458d5f582719350abb80fc788b67001365010cf1040755c2d9a67496ff0918
|
File details
Details for the file simple_agentcore_runtime_patterns-0.0.0-py3-none-any.whl.
File metadata
- Download URL: simple_agentcore_runtime_patterns-0.0.0-py3-none-any.whl
- Upload date:
- Size: 40.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b39a5a2f9c0356f61396944ba255fd28ed88927ffdad4f3fed2f088054c260b3
|
|
| MD5 |
0bdcfeee51cc6d534c2dbe2d843eb948
|
|
| BLAKE2b-256 |
20964f567a384abbecf67518e120e5fa72c23679fda391d33f890f0bb7bc5eff
|