Skip to main content

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

Requirements

  • AWS CDK v2.221.0 or later
  • Node.js 22 or later
  • Docker (for building container images)

License

MIT-0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

simple_agentcore_runtime_patterns-0.0.0.tar.gz (41.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file simple_agentcore_runtime_patterns-0.0.0.tar.gz.

File metadata

File hashes

Hashes for simple_agentcore_runtime_patterns-0.0.0.tar.gz
Algorithm Hash digest
SHA256 3a1168e5cdf3265081a14dcd6c0f3b35c2413add416fb4097e94bc6c6529d929
MD5 06ed4c44715eeb921477ff7566cca2e1
BLAKE2b-256 03458d5f582719350abb80fc788b67001365010cf1040755c2d9a67496ff0918

See more details on using hashes here.

File details

Details for the file simple_agentcore_runtime_patterns-0.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for simple_agentcore_runtime_patterns-0.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b39a5a2f9c0356f61396944ba255fd28ed88927ffdad4f3fed2f088054c260b3
MD5 0bdcfeee51cc6d534c2dbe2d843eb948
BLAKE2b-256 20964f567a384abbecf67518e120e5fa72c23679fda391d33f890f0bb7bc5eff

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page