Short answer: run short, evented CrewAI missions serverless with AgentCore and Lambda; choose containerised Fargate when workflows are long running or you need container-level observability. This guide walks eight concrete steps to move a CrewAI pilot into production on Amazon Bedrock, using infrastructure-as-code patterns and either serverless or container runtimes. Amazon Bedrock supplies the foundation models, CrewAI provides orchestration and workflow control, and AgentCore offers a production runtime with Memory, Identity, Gateway and Observability. AWS documentation and an aws-samples GitHub project provide Terraform and CDK examples wiring S3, Lambda, API Gateway, Fargate, DynamoDB and CloudFront. As Swami Sivasubramanian, Vice President, AWS Agentic AI, puts it, "With agents come a shift to service as software."
What this guide covers and who it's for. This is an evergreen, practical playbook for engineering teams that want to run multi agent AI at enterprise scale on AWS. It preserves the official split in responsibilities: Amazon Bedrock for foundation models and inference, CrewAI for agent orchestration and workflow control, and AgentCore as the production runtime and tool surface. The remainder of the article walks eight steps from architecture choice to scaling and governance, with the exact prerequisites and implementation notes referenced in the official AWS prescriptive guidance and the aws-samples repository.
1. Planning and prerequisites
Step 1, choose the architecture and confirm Bedrock model eligibility. Decide whether agents will run inside AgentCore's serverless runtime or in containers on AWS Fargate. AgentCore supports only foundation models available through Amazon Bedrock, so inventory the models you need and confirm they're offered on Bedrock. If you require image generation or multimodal outputs, the aws-samples project demonstrates how to integrate Bedrock image models alongside text models.
Step 2, assemble prerequisites and local tooling. Use the AWS prescriptive Terraform pattern as the baseline: an active AWS account with Bedrock access, Terraform 1.5 or later, Python 3.9 or later and the CrewAI framework installed. If you adopt the aws-samples CDK reference, ensure AWS CDK version 2.1005.0 or newer, Node.js 16.x or later, npm 8.x or later and Poetry 1.4.0 or later for Python dependency management. Community migration guides also recommend Docker, the AWS CLI and the bedrock-agentcore Python packages for local testing and some deployment workflows. A practical worked example: if your team runs local validation environments, install Docker, configure the AWS CLI with the Bedrock enabled account, then confirm Terraform 1.5 and Python 3.9 are available before you begin.
2. Porting agents and adapting tools
Step 3, port agents to Bedrock compatible foundation models and update tool adapters. Modify each CrewAI agent configuration to target a Bedrock model name and API parameters rather than a local LLM endpoint. Where agents call external services, map those tools into AgentCore Gateway or convert them into Model Connector Protocol compatible wrappers if you plan to use AgentCore tooling. Note that AgentCore's Gateway can automate some of those conversions, but you should inventory tool interfaces and required credentials first.
Step 4, convert your app to a remote AgentCore entrypoint if you choose the AgentCore runtime. The recommended pattern is a simple handler that instantiates the BedrockAgentCore runtime and delegates invocations to your CrewAI orchestration kickoff. Community examples show a minimal Python entrypoint that imports bedrock_agentcore.runtime, creates a BedrockAgentCoreApp and implements an @app.entrypoint handler that accepts a prompt payload and returns the CrewAI result. This frees you from managing server processes so AgentCore can manage execution, memory and tooling at scale. Worked example: replace a local Flask endpoint with a single entrypoint function annotated for AgentCore and let AgentCore handle concurrency and Memory persistence.
3. Codify infrastructure and deploy
Step 5, codify infrastructure and security as infrastructure as code. The AWS prescriptive guidance uses Terraform to create Lambda functions or other compute, S3 buckets for code and reports, CloudWatch log groups, least privilege IAM roles and EventBridge rules for scheduling. The aws-samples reference provides a fuller stack using CDK that pairs a React front end hosted on S3 and CloudFront with API Gateway and Lambda for CRUD operations, DynamoDB for state, and a CrewAI orchestration service on Fargate that communicates with Bedrock FMs for text and image generation.
Step 6, deploy and exercise the system. For the Terraform pattern, clone the repository and run terraform apply to provision resources and register the CrewAI service with Bedrock constructs. For containerised patterns, build and push container images, deploy the Fargate service and wire API Gateway and CloudFront. Use EventBridge or API triggers to invoke missions and perform smoke tests that validate model calls, memory persistence, tool invocation and end to end mission completion. Worked example: deploy the Terraform sample, schedule a test mission with EventBridge and confirm the Lambda invocation returns a CrewAI mission report in the designated S3 bucket.
Important design decision to make here. Use Lambda and AgentCore serverless for short lived, evented or scheduled workloads where executions are brief. Choose Fargate when agents perform long running workflows, need persistent TCP connections or local caches, or when you require container level observability and control.
Step 7, enable observability, validation and governance. Wire AgentCore Observability and CloudWatch and consider third party tracing such as LangFuse or AgentOps for richer traces and replayable evidence. Map CrewAI flows to Bedrock model configurations, Memory retention rules and Identity policies so agent actions are auditable and constrained by enterprise guardrails. Implement least privilege IAM roles and use AgentCore Identity to control what agents can access when acting on behalf of users.
Step 8, iterate on scaling and operational hardening. Track Terraform state management for large, multi environment deployments and consider splitting state per environment. Check AWS regional availability for the services you plan to use, since some services in these patterns aren't available in every region. Monitor cost drivers such as model invocation volume, runtime duration and storage, and tune batch sizes, agent timeouts and tool usage accordingly. The aws-samples project includes mission templates and a no code visual interface that can accelerate iteration; migrate hardened flows into the IaC managed production stack when they're stable. Worked example: split Terraform state between staging and production, run replayable missions against a replay dataset, and use CloudWatch metrics to identify model invocation hot spots before moving to a global rollout.
Operational constraints to plan for. Model context window limits are an inherent constraint on agent interactions and must be part of flow design. Terraform state management becomes material at scale. Finally, regional service availability may dictate where you can deploy because some components used in the sample stacks aren't uniformly available across AWS regions.
Point is, security and compliance note. Map guardrails to AgentCore Identity and CrewAI Memory policies, capture execution traces for each mission and keep a supply of replayable tests and logs for compliance reviews. These measures are the core of making agent teams auditable under enterprise security policies.
Implementation notes and variations
The official materials present two canonical patterns. The AWS prescriptive guidance describes a Terraform driven serverless pattern that deploys an AWS Lambda to run the CrewAI application, S3 buckets for code and reports, IAM roles with scoped permissions, CloudWatch logging and an EventBridge rule for scheduled executions. This aws-samples GitHub project demonstrates a fuller stack where a React front end on S3 and CloudFront sits in front of API Gateway and Lambda for CRUD operations, with DynamoDB for state and a CrewAI orchestration service running on AWS Fargate that communicates with Bedrock models for text and image generation.
Choose the pattern that matches your operational preferences. If your agents need ephemeral, synchronous execution that scales to zero between events, serverless Lambda plus AgentCore is simpler. If you need sustained throughput, longer lived tasks or container specific tooling, Fargate is the more natural fit. Either way, codify compute, storage, networking and IAM with Terraform or CDK so deployments are repeatable and auditable.
Case studies and expected ROI. CrewAI case study materials report early pilot improvements: a Fortune scale code modernisation finished about 70 percent faster, and a consumer packaged goods back office flow cut processing time by about 90 percent. Those figures illustrate potential ROI when a pilot successfully migrates to production, but they're drawn from CrewAI case materials and should be validated in your environment before you base financial forecasts on them.
Tooling checklist to consider during migration: confirm Bedrock model availability for the tasks you need, prepare IAM roles and AgentCore Identity mappings, update agent tool adapters to integrate with AgentCore Gateway or MCP wrappers, and include tracing targets such as CloudWatch, LangFuse or AgentOps. For local testing include Docker, the AWS CLI and the bedrock-agentcore Python packages where helpful. Follow the version constraints listed in the prescriptive guide and the aws-samples repo for the pattern you choose.
How to validate a production mission. Create a small set of representative missions, run them with controlled inputs and capture the model calls, memory snapshots and tool invocations.
Use replayable tests to verify guardrails, retention rules and Identity constraints. Collect logs and traces into a central store and run a compliance review before wider rollout.
For your rollout plan, plan a staged migration: pilot on Lambda plus AgentCore for short missions, migrate a subset of hardened flows to Fargate where statefulness or throughput requires it, and then move the longest running or highest risk missions behind stricter Identity and observability controls.
In short: 1. Confirm Bedrock model eligibility and pick Lambda or Fargate. 2. Install the required tooling versions and collect dependencies. 3. Port agents to Bedrock models and adapt tools to AgentCore Gateway. 4. Codify infrastructure with Terraform or CDK, deploy, test and instrument. 5. Add observability and guardrails and iterate on scale and cost.
Related Articles
- Open a UK business bank account fast: 6 steps
- 3 AI IDEs Compared: Choose by Autonomy, Models, Security
- 3 Best Smart Ring Brands for 2026: Oura, RingConn, Samsung
Clone the aws-samples repository referenced in the AWS prescriptive guidance and run the provided provisioning command, for example terraform apply in the Terraform pattern, to provision the example stack. Then schedule a test mission, for example via EventBridge, and confirm model invocations, Memory persistence and tool integration before you scale the deployment.
This article was created with AI assistance.