# agentcore-deploy > Deploy AI agents to Amazon Bedrock AgentCore using Strands Agents framework. Use when users want to (1) deploy an agent to AgentCore, (2) create a serverless AI agent on AWS, (3) build and deploy Strands agents to production, (4) set up AgentCore runtime for AI agents. Supports weather agents, chatbots, and any HTTP-based agent deployment. - Author: jiahaoliu1891 - Repository: jiahaoliu1891/agent-frameworks - Version: 20260107114208 - Stars: 0 - Forks: 0 - Last Updated: 2026-02-07 - Source: https://github.com/jiahaoliu1891/agent-frameworks - Web: https://mule.run/skillshub/@@jiahaoliu1891/agent-frameworks~agentcore-deploy:20260107114208 --- --- name: agentcore-deploy description: Deploy AI agents to Amazon Bedrock AgentCore using Strands Agents framework. Use when users want to (1) deploy an agent to AgentCore, (2) create a serverless AI agent on AWS, (3) build and deploy Strands agents to production, (4) set up AgentCore runtime for AI agents. Supports weather agents, chatbots, and any HTTP-based agent deployment. --- # AgentCore Deploy Skill Deploy AI agents to Amazon Bedrock AgentCore with Strands Agents framework. ## Quick Start 1. Copy template from `assets/templates/` 2. Customize agent logic in `main.py` 3. Run `python deploy_sdk.py` 4. Test with `python test_agent.py` ## Project Structure ``` my-agent/ ├── main.py # Agent HTTP server (required) ├── requirements.txt # Dependencies ├── deploy_sdk.py # Deployment script └── test_agent.py # Test script ``` ## Core Requirement: HTTP Server AgentCore requires agents to run as HTTP servers with two endpoints: | Endpoint | Method | Purpose | |----------|--------|---------| | `/ping` | GET | Health check | | `/invocations` | POST | Handle requests | ```python from http.server import HTTPServer, BaseHTTPRequestHandler import json from strands import Agent agent = Agent(system_prompt="...", tools=[...]) class AgentHandler(BaseHTTPRequestHandler): def do_GET(self): if self.path == "/ping": self.send_response(200) self.end_headers() self.wfile.write(json.dumps({"status": "healthy"}).encode()) def do_POST(self): if self.path == "/invocations": data = json.loads(self.rfile.read(int(self.headers.get("Content-Length", 0)))) result = agent(data.get("prompt", "")) self.send_response(200) self.end_headers() self.wfile.write(json.dumps({"output": {"message": str(result)}}).encode()) if __name__ == "__main__": HTTPServer(("0.0.0.0", 8080), AgentHandler).serve_forever() ``` ## Deployment ### Using Python SDK (Recommended) ```python from bedrock_agentcore_starter_toolkit import Runtime runtime = Runtime() runtime.configure( entrypoint="main.py", auto_create_execution_role=True, auto_create_ecr=True, requirements_file="requirements.txt", region="us-east-1", agent_name="my_agent" # Only letters, numbers, underscores ) launch_result = runtime.launch() print(f"Agent ARN: {launch_result.agent_arn}") ``` ### Using CLI ```bash agentcore configure -e main.py -n my_agent agentcore deploy ``` ## Testing Deployed Agent ```python import json, uuid, boto3 client = boto3.client('bedrock-agentcore', region_name='us-east-1') response = client.invoke_agent_runtime( agentRuntimeArn="arn:aws:bedrock-agentcore:...", runtimeSessionId=f"test-{uuid.uuid4()}", # Must be ≥33 chars payload=json.dumps({"prompt": "Hello"}).encode() ) body = response['response'].read() print(json.loads(body.decode())) ``` ## Common Pitfalls See [references/pitfalls.md](references/pitfalls.md) for detailed solutions to: 1. Agent name format (no hyphens, use underscores) 2. CLI requires interactive terminal (use SDK instead) 3. IAM role propagation delay (wait 30s and retry) 4. File permissions (chmod 644) 5. Agent must be HTTP server (not one-time script) 6. Session ID minimum length (≥33 characters) ## Useful Commands ```bash # Deploy python deploy_sdk.py # Test python test_agent.py # View logs aws logs tail /aws/bedrock-agentcore/runtimes/-DEFAULT \ --log-stream-name-prefix "[runtime-logs]" --since 10m --region us-east-1 # Local test python main.py curl -X POST http://localhost:8080/invocations \ -H "Content-Type: application/json" \ -d '{"prompt": "Hello"}' ``` ## Templates Ready-to-use templates in `assets/templates/`: - `weather_agent/` - Weather query agent using National Weather Service API