JSPM

  • Created
  • Published
  • Downloads 3903
  • Score
    100M100P100Q133968F
  • License Apache-2.0

L3 CDK constructs for Amazon Bedrock AgentCore

Package Exports

  • @aws/agentcore-cdk

Readme

@aws/agentcore-cdk

L3 CDK constructs for Amazon Bedrock AgentCore. Deploy agent infrastructure with strongly-typed, declarative specifications.

Installation

npm install @aws/agentcore-cdk

Note: aws-cdk-lib and constructs are peer dependencies. If you don't already have them:

npm install @aws/agentcore-cdk aws-cdk-lib constructs

Quick Start

import { AgentCoreApplication, AgentCoreMcp } from '@aws/agentcore-cdk';
import type { AgentCoreProjectSpec } from '@aws/agentcore-cdk';
import { Stack } from 'aws-cdk-lib';

const spec: AgentCoreProjectSpec = {
  name: 'my-project',
  agents: [
    {
      name: 'my-agent',
      targetLanguage: 'Python',
      sdk: 'Strands',
      runtime: {
        artifact: 'CodeZip',
        codeLocation: 'app/my-agent',
        handler: 'main.handler',
        pythonRuntime: 'python3.12',
      },
    },
  ],
};

class MyStack extends Stack {
  constructor(scope: Construct, id: string) {
    super(scope, id);
    new AgentCoreApplication(this, 'App', { spec });
  }
}

Constructs

AgentCoreApplication

Main L3 construct for deploying agent environments.

AgentCoreMcp

L3 construct for MCP gateways and tools.

AgentEnvironment

Individual agent environment construct.

Standalone Usage

These constructs can be used independently without the CLI:

import { AgentCoreApplication, ConfigIO } from '@aws/agentcore-cdk';

// Option 1: Pass spec directly
new AgentCoreApplication(this, 'App', {
  spec: {
    name: 'my-project',
    agents: [{ name: 'my-agent', targetLanguage: 'Python', ... }]
  },
});

// Option 2: Read from disk (using built-in ConfigIO)
const configIO = new ConfigIO({ baseDir: './agentcore' });
const spec = await configIO.readProjectSpec();
new AgentCoreApplication(this, 'App', { spec });
  • @aws/agentcore - CLI tool that uses these constructs via templated CDK projects

Security

See CONTRIBUTING for more information.

License

This project is licensed under the Apache-2.0 License.