Infrastructure
Every AWS resource Morpheus uses is declared in one of two places. There is no console-created infrastructure and no Terraform.
| Stack | Tool | Language | Owns |
|---|---|---|---|
|
AWS CDK |
TypeScript |
The AgentCore runtime — container image, Bedrock AgentCore runtime and memory, its IAM role, its log group |
|
AWS SAM |
YAML |
Five Lambda functions, five layers, three queues and their dead-letter queues, every schedule, the shared secret, one alarm |
They deploy independently, share no CloudFormation exports, and reference each other through nothing at all. The coupling between the two halves of the platform is at the data level — the same PostgreSQL database, the same HubSpot portal — not at the infrastructure level.
| Page | Contents |
|---|---|
Every construct, the image asset, memory strategies, outputs |
|
Globals, parameters, all five functions, outputs |
|
FIFO configuration, visibility timeouts, redrive, partial batch failure |
|
Every rule, its cron or rate expression, and its |
|
The five layers, layer order, and how they are built |
|
The two secrets, every key, and how each unit loads them |
|
Runtime role policies, SAM-generated roles, the permission model |
|
Sentry, CloudWatch, X-Ray, the Bedrock token alarm |
Deploying
make deploy-cdk # cd cdk && npx cdk bootstrap && npm run cdk:deploy
make deploy-lambdas # cd lambdas && make deploy
make deploy-lambdas regenerates every function’s requirements.txt with
uv export --no-dev --no-hashes before running sam build --no-cached && sam deploy. That
regeneration step is why a dependency change made in a pyproject.toml reaches Lambda without
anyone editing a requirements.txt by hand.
Single functions can be deployed alone — make deploy-scraper, deploy-scorer,
deploy-hubspot, deploy-email-agent, deploy-phone-agent — each of which syncs only that
function’s requirements and builds only that function. Full details in
Deployment.
|
There is no deployment pipeline. The only GitHub Actions workflow is
|
Architecture split
The two stacks target different CPU architectures, and neither is negotiable independently.
| Unit | Architecture | Why |
|---|---|---|
AgentCore container |
|
|
Lambda functions |
|
Set in the SAM |
A layer built for one architecture will not load on a function running the other, so changing the SAM architecture means changing all five layer declarations in the same commit.
What is not in code
Three things the stacks reference but do not create:
| Resource | Where it comes from |
|---|---|
The secret value of |
SAM creates an empty secret; the JSON is populated by hand. See Secrets Manager. |
The SNS topic |
Referenced by |
The BigQuery views under |
Applied manually with |
Each is a place where a fresh environment will deploy cleanly and then misbehave at runtime. The bootstrap sequence for a new account is in Deployment.