DEV Community

Cover image for AWS AgentCore Deployment Guide: Part II – Deploying SreeniBot to Production
Seenivasa Ramadurai
Seenivasa Ramadurai

Posted on

AWS AgentCore Deployment Guide: Part II – Deploying SreeniBot to Production

Introduction

Welcome back to our AWS AgentCore journey!

In Part I https://dev.to/sreeni5018/introducing-aws-bedrock-agentcore-a-modular-platform-for-deploying-ai-agents-at-enterprise-scale-369p

we explored what AWS AgentCore is, its modular architecture, and how to build an AI agent (SreeniBot) locally.

Now it’s time to take things up a notch we’re going from local setup to production deployment using AWS Bedrock AgentCore. By the end of this guide, your agent will be running on the cloud scalable, observable, and production-ready.

Prerequisites

Before deploying to AgentCore, make sure you have the following:

AWS Account Setup

  1. An active AWS account with necessary permissions
  2. AWS CLI configured with credentials
  3. Access to AWS Bedrock and AgentCore

Development Environment

  1. Python 3.8+ installed
  2. Your local SreeniBot application ready from *Part I *(https://dev.to/sreeni5018/introducing-aws-bedrock-agentcore-a-modular-platform-for-deploying-ai-agents-at-enterprise-scale-369p )
  3. Basic understanding of containerization

Required IAM Permissions

Your user or role should have access to:

bedrock-agentcore:*
iam:CreateRole, iam:AttachRolePolicy
ecr:CreateRepository, ecr:GetAuthorizationToken
codebuild:CreateProject, codebuild:StartBuild
s3:PutObject, s3:GetObject
logs:CreateLogGroup, logs:CreateLogStream

AgentCore Starter Kit Setup

Step 1: Install the Starter Kit

pip install bedrock-agentcore-starter-toolkit
agentcore --help

Step 2: Verify AWS Configuration

aws configure list

aws bedrock list-foundation-models --region us-east-1

You should see your AWS credentials, region, and profile correctly listed.

Step 1: Initialize AgentCore Configuration

cd /path/to/your/sreenibot-project

agentcore configure \
--name sreenibot \
--entrypoint main.py \
--requirements-file requirements.txt \
--region us-east-1 \
--non-interactive

This command automatically generates configuration files, IAM roles, and an ECR repository for your project.

Deployment Process

Step 1: Launch Your Agent

Deploy your agent to AWS AgentCore:

agentcore launch

Deployment Process Breakdown:

Phase 1: Memory Setup

Creating memory resource for agent: sreenibot
✅ MemoryManager initialized for region: us-east-1
🔎 Retrieving memory resource with ID: sreenibot_mem-PHIirj4zkP...
Found memory: sreenibot_mem-PHIirj4zkP
Found existing memory in cloud: sreenibot_mem-PHIirj4zkP
✅ Using existing STM-only memory

Phase 2: AWS Resources Setup

Starting CodeBuild ARM64 deployment for agent 'sreenibot' to account YOUR-ACCOUNT-ID
Setting up AWS resources (ECR repository, execution roles)...

Getting or creating ECR repository for agent: sreenibot
✅ Reusing existing ECR repository:
[YOUR-ACCOUNT-ID].dkr.ecr.us-east-1.amazonaws.com/bedrock-agentcore-sreenibot

Getting or creating execution role for agent: sreenibot
✅ Reusing existing execution role:
arn:aws:iam::[YOUR-ACCOUNT-ID]:role/AmazonBedrockAgentCoreSDKRuntime-us-east-1-[UNIQUE-ID]

Phase 3: CodeBuild Process

Preparing CodeBuild project and uploading source...
Using dockerignore.template with 45 patterns for zip filtering
Including Dockerfile from .bedrock_agentcore/sreenibot in source.zip
Uploaded source to S3: sreenibot/source.zip
Updated CodeBuild project: bedrock-agentcore-sreenibot-builder

Starting CodeBuild build (this may take several minutes)...
🔄 QUEUED started (total: 0s)
✅ QUEUED completed in 1.1s
🔄 PROVISIONING started (total: 1s)
✅ PROVISIONING completed in 8.8s
🔄 DOWNLOAD_SOURCE started (total: 10s)
✅ DOWNLOAD_SOURCE completed in 2.2s
🔄 BUILD started (total: 12s)
✅ BUILD completed in 9.8s
🔄 POST_BUILD started (total: 22s)
✅ POST_BUILD completed in 6.6s
🔄 FINALIZING started (total: 29s)
✅ FINALIZING completed in 1.1s
🔄 COMPLETED started (total: 30s)
✅ COMPLETED completed in 1.1s
🎉 CodeBuild completed successfully in 0m 30s

Phase 4: AgentCore Deployment

Deploying to Bedrock AgentCore...
Passing memory configuration to agent: sreenibot_mem-[UNIQUE-ID]
✅ Agent created/updated:
arn:aws:bedrock-agentcore:us-east-1:[YOUR-ACCOUNT-ID]:runtime/sreenibot-[UNIQUE-ID]

Observability is enabled, configuring Transaction Search...
CloudWatch Logs resource policy already configured
X-Ray trace destination already configured
X-Ray indexing rule already configured
✅ Transaction Search already fully configured

🔍 GenAI Observability Dashboard:
https://console.aws.amazon.com/cloudwatch/home?region=us-east-1#gen-ai-observability/agent-core

Polling for endpoint to be ready...
Agent endpoint:
arn:aws:bedrock-agentcore:us-east-1:[YOUR-ACCOUNT-ID]:runtime/sreenibot-[UNIQUE-ID]/runtime-endpoint/DEFAULT

Deployment completed successfully!

Testing Your Deployed Agent

Step 1: Basic Functionality Test

Test your deployed agent with a simple message:

agentcore invoke '{"prompt": "Hello SreeniBot! How are you?"}'

Expected Response:

{
"result": "Hello! I'm SreeniBot, your AWS AgentCore agent. You said: 'Hello SreeniBot! How are you?'. I have context from 1 messages in this conversation.",
"session_id": "[SESSION-ID]",
"has_context": true,
"message_count": 2
}

Step 2: Context Memory Test

Test conversation memory by referencing previous messages:

agentcore invoke '{"prompt": "What did I just say?", "session_id": "bef11bb6-a37b-423a-b28e-d0eef9e425fb"}'

Expected Response:

{
"result": "Hello! I'm SreeniBot, your AWS AgentCore agent. You said: 'What did I just say?'. I have context from 3 messages in this conversation.",
"session_id": "[SESSION-ID]",
"has_context": true,
"message_count": 4
}

Step 3: Check Agent Status

Monitor your agent's health and configuration:

agentcore status

Monitoring & Observability

CloudWatch Logs

Monitor your agent's runtime logs:

Follow logs in real-time

aws logs tail /aws/bedrock-agentcore/runtimes/sreenibot-[UNIQUE-ID]-DEFAULT \
--log-stream-name-prefix "[DATE]/[runtime-logs]" \
--follow

View logs from the last hour

aws logs tail /aws/bedrock-agentcore/runtimes/sreenibot-[UNIQUE-ID]-DEFAULT \
--log-stream-name-prefix "[DATE]/[runtime-logs]" \
--since 1h

GenAI Observability Dashboard
Access the comprehensive observability dashboard:

URL: https://console.aws.amazon.com/cloudwatch/home?region=us-east-1#gen-ai-observability/agent-core
Features: Request tracing, performance metrics, error analysis
Data Latency: Up to 10 minutes for initial data appearance

Building Client Apps for Your Deployed SreeniBot

Now let us see how to create various types of client applications that can interact with your deployed AWS AgentCore agent. We'll cover web apps, mobile apps, CLI tools, and API integrations.

Understanding AgentCore Endpoints

Your Deployed Agent Details
From our successful deployment, your SreeniBot has:

{
"agent_name": "sreenibot",
"agent_arn": "arn:aws:bedrock-agentcore:us-east-1:[YOUR-ACCOUNT-ID]:runtime/sreenibot-[UNIQUE-ID]",
"endpoint": "arn:aws:bedrock-agentcore:us-east-1:[YOUR-ACCOUNT-ID]:runtime/sreenibot-[UNIQUE-ID]/runtime-endpoint/DEFAULT",
"region": "us-east-1",
"memory_id": "sreenibot_mem-[UNIQUE-ID]"
}

Invocation Methods

1. Direct AgentCore CLI (for testing):

agentcore invoke '{"prompt": "Hello", "session_id": "optional-session-id"}'

2. AWS SDK (for applications):

import boto3

client = boto3.client('bedrock-agentcore-runtime', region_name='us-east-1')
response = client.invoke_agent(
    agentId='sreenibot-[UNIQUE-ID]',
    sessionId='your-session-id',
    inputText='Hello SreeniBot!'
)
Enter fullscreen mode Exit fullscreen mode

3. HTTP API (if API Gateway is configured):

POST https://your-api-gateway-url/invoke
Authorization: AWS4-HMAC-SHA256 ...
Content-Type: application/json

{
"prompt": "Hello SreeniBot!",
"session_id": "optional-session-id"
}
Authentication & Authorization
AWS IAM Authentication
Your client applications need proper AWS credentials to invoke the AgentCore agent.

  1. IAM Policy for Client Applications:

{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"bedrock-agentcore:InvokeAgent",
"bedrock-agentcore:GetAgent"
],
"Resource": [
"arn:aws:bedrock-agentcore:us-east-1:[YOUR-ACCOUNT-ID]:runtime/sreenibot-[UNIQUE-ID]"
]
}
]
}

Web Client

AWS Console

Conclusion

Congratulations! 🎉

You’ve successfully deployed SreeniBot to the AWS AgentCore production environment. Your agent is now:

✅ Cloud-Ready – Running on AWS Bedrock infrastructure
✅ Scalable – Auto-scales based on demand
✅ Observable – With complete monitoring and logging (see it in cloudWatch)
✅ Context-Aware – Retains short-term memory
✅ Production-Grade – Follows AWS best practices

Key Takeaways

  1. The AgentCore Starter Kit makes deployment fast and repeatable.
  2. ARM64 containers offer better cost-performance balance.
  3. Memory configuration drives both functionality and cost efficiency.
  4. Built-in observability ensures smooth operations.

Thanks
Sreeni Ramadorai

Top comments (2)

Collapse
 
funnydark0901 profile image
Andrew Pendergast • Edited

Mr. Seenivasa, thank you so much for posting this so quickly. Your post is deeply thought-provoking, both in its logical depth and its kindness to others. Thank you so much, sir. After reading your post, I think AgentCore is a huge leap forward in bridging the gap between research-grade agent frameworks and production-grade deployments.
I'm very intrigued by the Starter Toolkit workflow and the observability integration with CloudWatch + X-Ray.
Thank you so much, sir.

Collapse
 
sreeni5018 profile image
Seenivasa Ramadurai

When deploying agents to AWS AgentCore, enabling observability is a must. It’s essential for monitoring, debugging, and understanding how your agents behave in production.

The AgentCore Starter Toolkit makes this process much easier it provides a streamlined way to deploy your agent code to the serverless AgentCore infrastructure. This toolkit comes with multiple options to configure, launch, and invoke your agents, allowing you to quickly test them right after deployment.

And if you’re integrating an MCP server, the AgentCore Gateway has you covered. It handles the end-to-end deployment of your MCP server automatically, so you don’t have to deal with the complexity of setting up Docker images, ECR repositories, or EKS clusters manually.

Thank you