AWS bedrock-agentcore documentation change
Summary
Updated tutorial to use CodeZip deployment instead of container-based deployment, simplified steps from 9 to 7, removed Docker requirement, added AWS CDK prerequisite, updated Node.js version to 22+, removed streaming responses section, and restructured common issues
Security assessment
Changes involve deployment method updates (CodeZip vs Container), prerequisite adjustments, and tutorial simplification. No evidence of security vulnerability fixes, security incident references, or new security feature documentation. The removal of container-specific security practices (non-root user) is due to deployment method change, not a security fix.
Diff
diff --git a/bedrock-agentcore/latest/devguide/runtime-get-started-cli-typescript.md b/bedrock-agentcore/latest/devguide/runtime-get-started-cli-typescript.md index 289801ce5..a3cf04aa0 100644 --- a//bedrock-agentcore/latest/devguide/runtime-get-started-cli-typescript.md +++ b//bedrock-agentcore/latest/devguide/runtime-get-started-cli-typescript.md @@ -7 +7 @@ -PrerequisitesStep 1: Install the AgentCore CLI and create a projectStep 2: Create your TypeScript agentStep 3: Review your project configurationStep 4: Test your agent locallyStep 5: Enable observability for your agentStep 6: Deploy to Amazon Bedrock AgentCore RuntimeStep 7: Test your deployed agentStep 8: Invoke your agent programmaticallyStep 9: Stop session or clean upFind your resourcesCommon issues and solutionsAdvanced: Streaming responses +PrerequisitesStep 1: Install the AgentCore CLIStep 2: Create your agent projectStep 3: Test your agent locallyStep 4: Deploy to Amazon Bedrock AgentCore RuntimeStep 5: Test your deployed agentStep 6: Invoke your deployed agent programmaticallyStep 7: Clean upFind your resourcesCommon issues and solutions @@ -11 +11 @@ PrerequisitesStep 1: Install the AgentCore CLI and create a projectStep 2: Creat -This tutorial shows you how to use the AgentCore CLI ( [agentcore-cli](https://github.com/aws/agentcore-cli) ) to deploy a TypeScript agent to an Amazon Bedrock AgentCore Runtime. +This tutorial shows you how to use the [AgentCore CLI](https://github.com/aws/agentcore-cli) to create, deploy, and invoke a TypeScript agent on Amazon Bedrock AgentCore Runtime. This tutorial takes approximately 20 minutes to complete. @@ -13 +13,3 @@ This tutorial shows you how to use the AgentCore CLI ( [agentcore-cli](https://g -The AgentCore CLI is a command-line tool that you can use to create, develop, and deploy AI agents to an Amazon Bedrock AgentCore Runtime. This tutorial shows you how to create and deploy a TypeScript agent using the [bedrock-agentcore](https://www.npmjs.com/package/bedrock-agentcore) SDK. +The AgentCore CLI is a command-line tool that scaffolds agent projects, deploys them to Amazon Bedrock AgentCore Runtime, and invokes them. This tutorial uses the [Strands Agents](https://strandsagents.com/latest/) framework with TypeScript and direct code deployment (CodeZip). + +The AWS resources created in this tutorial might result in charges to your AWS account. When you finish the tutorial, you can remove resources by following the steps in Step 7: Clean up. @@ -21,3 +23 @@ For information about the HTTP protocol that the agent uses, see [HTTP protocol - * Step 1: Install the AgentCore CLI and create a project - - * Step 2: Create your TypeScript agent + * Step 1: Install the AgentCore CLI @@ -25 +25 @@ For information about the HTTP protocol that the agent uses, see [HTTP protocol - * Step 3: Review your project configuration + * Step 2: Create your agent project @@ -27 +27 @@ For information about the HTTP protocol that the agent uses, see [HTTP protocol - * Step 4: Test your agent locally + * Step 3: Test your agent locally @@ -29 +29 @@ For information about the HTTP protocol that the agent uses, see [HTTP protocol - * Step 5: Enable observability for your agent + * Step 4: Deploy to Amazon Bedrock AgentCore Runtime @@ -31 +31 @@ For information about the HTTP protocol that the agent uses, see [HTTP protocol - * Step 6: Deploy to Amazon Bedrock AgentCore Runtime + * Step 5: Test your deployed agent @@ -33 +33 @@ For information about the HTTP protocol that the agent uses, see [HTTP protocol - * Step 7: Test your deployed agent + * Step 6: Invoke your deployed agent programmatically @@ -35,3 +35 @@ For information about the HTTP protocol that the agent uses, see [HTTP protocol - * Step 8: Invoke your agent programmatically - - * Step 9: Stop session or clean up + * Step 7: Clean up @@ -43,2 +40,0 @@ For information about the HTTP protocol that the agent uses, see [HTTP protocol - * Advanced: Streaming responses - @@ -54 +50 @@ Before you start, make sure you have: - * **Node.js 20+** installed + * **Node.js 22+** installed. The AgentCore CLI is distributed as an npm package, and the generated agent code is TypeScript. We recommend installing the same major version you plan to deploy on AgentCore Runtime. For supported versions, see [Supported language runtimes](./runtime-code-deploy-supported-runtimes.html). @@ -56 +52 @@ Before you start, make sure you have: - * **Docker** (or [Podman](https://podman.io) or [Finch](https://runfinch.com) ) installed. A container runtime is required for building and testing your TypeScript agent locally. A local container runtime is not required for `agentcore deploy` because AWS CodeBuild builds the image remotely. + * **AWS CDK** installed. The CLI uses the AWS CDK to deploy resources. To install the AWS CDK, see [Getting started with the AWS CDK](https://docs.aws.amazon.com/cdk/v2/guide/getting_started.html). @@ -60 +56 @@ Before you start, make sure you have: - * **Model access** : If your agent uses Amazon Bedrock models, ensure the required models are [enabled](https://docs.aws.amazon.com/bedrock/latest/userguide/model-access-modify.html) in the Amazon Bedrock console. + * **Model access** : Anthropic Claude Sonnet 4 [enabled](https://docs.aws.amazon.com/bedrock/latest/userguide/model-access-modify.html) in the Amazon Bedrock console (if using Bedrock as the model provider). For information about using a different model with Strands Agents, see the _Model Providers_ section in the [Strands Agents SDK](https://strandsagents.com/latest/documentation/docs/) documentation. @@ -65 +61 @@ Before you start, make sure you have: -## Step 1: Install the AgentCore CLI and create a project +## Step 1: Install the AgentCore CLI @@ -72 +68 @@ Install the AgentCore CLI globally: -Verify installation: +Verify the installation: @@ -77 +73,3 @@ Verify installation: -To deploy a TypeScript agent, use container-based deployment. Create a project without a default agent. You will add a TypeScript container agent in the next step. +## Step 2: Create your agent project + +Use the `agentcore create` command to scaffold a new TypeScript agent project: @@ -84,27 +82 @@ AgentCore CLI - 1. agentcore create --name MyTsAgent --no-agent - - - - -Interactive - - - 1. Run `agentcore create` without flags to launch the interactive wizard. Select "No" when asked to add an agent — you will add a TypeScript container agent in the next step: - - agentcore create - - - - - - -This command creates a project directory with the following structure: - - - MyTsAgent/ - agentcore/ - agentcore.json - aws-targets.json - -Change into the project directory: - + 1. Create a project without an agent, then add a TypeScript agent: @@ -111,0 +84 @@ Change into the project directory: + agentcore create --name MyTsAgent --no-agent @@ -113,13 +86 @@ Change into the project directory: - -## Step 2: Create your TypeScript agent - -This tutorial uses the [Strands Agents](https://strandsagents.com/latest/) framework, which is currently the supported framework for TypeScript agents deployed to AgentCore Runtime. - -Add a TypeScript agent to your project using the bring-your-own-code (BYO) workflow with container-based deployment: - -###### Example - -AgentCore CLI - - - 1. agentcore add agent --name TsAgent --type byo --build Container --language TypeScript --framework Strands --model-provider Bedrock --code-location app/TsAgent + agentcore add agent --name TsAgent --type create --build CodeZip --language TypeScript --framework Strands --model-provider Bedrock --memory none @@ -133,30 +94 @@ Interactive - 1. Run `agentcore add agent` to launch the interactive wizard. Select **Bring my own code** as the agent type: - - agentcore add agent - - 2. Select **Bring my own code** as the agent type: - - - - 3. Set the code location for your agent: - - - - 4. Review the configuration and confirm: - - - - - - -This command registers a TypeScript agent in `agentcore/agentcore.json` and creates a code directory for your agent at `app/TsAgent/`. - -Initialize the TypeScript project inside the agent code directory: - - - cd app/TsAgent - npm init -y - -Install the required packages: - - * **bedrock-agentcore** \- The Amazon Bedrock AgentCore SDK for building AI agents in TypeScript + 1. Run `agentcore create` without flags to launch the interactive wizard: @@ -164,154 +96 @@ Install the required packages: - * **@strands-agents/sdk** \- The [Strands Agents](https://strandsagents.com/latest/) SDK - - * **@opentelemetry/auto-instrumentations-node** \- OpenTelemetry instrumentation for observability - - * **typescript** \- TypeScript compiler - - - - - - npm install bedrock-agentcore @strands-agents/sdk @opentelemetry/auto-instrumentations-node --legacy-peer-deps - npm install --save-dev typescript @types/node tsx - -###### Note - -The `--legacy-peer-deps` flag resolves peer dependency conflicts between `@strands-agents/sdk` and `@opentelemetry/auto-instrumentations-node` . This is safe and does not affect runtime behavior. - -Create a `tsconfig.json` file with the following content: - - - { - "compilerOptions": { - "target": "ES2022", - "module": "NodeNext", - "moduleResolution": "NodeNext", - "outDir": "./dist", - "rootDir": ".", - "strict": true, - "esModuleInterop": true, - "skipLibCheck": true, - "declaration": true - }, - "include": ["*.ts"], - "exclude": ["node_modules", "dist"] - } - -Update your `package.json` to add the required configuration: - - - { - "name": "ts-agent", - "version": "1.0.0", - "type": "module", - "main": "dist/agent.js", - "scripts": { - "build": "tsc", - "start": "node dist/agent.js", - "dev": "npx tsx --watch agent.ts" - }, - "engines": { - "node": ">=20.0.0" - }, - "dependencies": { - "bedrock-agentcore": "^0.2.0", - "@strands-agents/sdk": "^0.1.5", - "@opentelemetry/auto-instrumentations-node": "^0.56.0" - }, - "devDependencies": {