Skip to content

Guide Deployment

Reese Hodge edited this page Sep 30, 2026 · 6 revisions

Guide: Deployment

This is a target-state runbook, not a report of a successful deploy. No deployed-account state was inspected for issue #57, and the runtime and Memory resources are absent from the checked CDK code.

The intended ownership is:

  • CDK owns the stacks: Cognito, WebSocket/Lambda integration, frontend hosting, budget controls, and the rest of the infrastructure modeled in packages/infra.
  • The AgentCore Runtime would move into CDK (decision 2026-09-27): the AgentCore constructs graduated into stable aws-cdk-lib/aws-bedrockagentcore and CloudFormation gained a PlatformVersion property, so the CLI-owns-the-runtime split is no longer technically required. T152 is unbuilt, and the constitution still mandates CLI agent deployment; an amendment decision is required before this can become the operational runbook. The CLI keeps local development.

Read Decision-AgentCore-Runtime-V2 before changing this split and Component-Infra-Stacks before editing stack code.

Prerequisites

Install and validate the repo first:

pnpm install
pnpm run validate

Deployment additionally requires the AWS CLI, AWS CDK CLI, AgentCore CLI, Docker for container-based agent work, and temporary AWS credentials supplied as environment variables. Per Concept-Credential-Hygiene, do not store long-lived access keys on disk and do not paste credentials into docs, chats, issues or pull requests.

Deploy guardrails first

The project has a hard budget ceiling. The infra plan calls out that spend guardrails should exist before runtime resources that can spend money. In practice, deploy or verify the budget controls before bringing up the agent runtime.

CDK-managed infrastructure

From the infra package, once the missing runtime/Memory work and constitution decision have been addressed:

cd packages/infra
npx cdk synth
npx cdk diff
npx cdk deploy --all

The quickstart describes these stacks:

Stack Role
CognitoStack Guest identity pool and scoped IAM roles
AgentStack WebSocket API, Lambda integration, SSM parameter imports, and memory-related infrastructure as implemented
FrontendStack S3 bucket and CloudFront distribution
BudgetStack Budget alarms and hard-stop controls

Keep deployment output and generated identifiers out of public wiki pages if they include account-specific values. This page intentionally uses only generic names and commands.

AgentCore Runtime V2

The agent runtime targets platform version V2 via CDK, but is not yet constructed in the CDK stack. Neither a CDK runtime deploy nor a V2 platform version was verified in AWS. The commands below are verification steps for T152 once the resource is implemented, not proof it already exists.

Changed 2026-09-27. This section previously said CDK/CloudFormation could not set the platform version, so the runtime had to be deployed with agentcore deploy. AWS::BedrockAgentCore::Runtime now exposes a PlatformVersion property and the constructs are stable. See Decision-AgentCore-Runtime-V2.

Because CDK codegen still lags the CloudFormation spec, the planned platform version needs an L1 escape hatch pinned by a CDK assertion — an untyped override that fails silently deploys V1 and looks like success:

const cfnRuntime = runtime.node.defaultChild as CfnRuntime;
cfnRuntime.addPropertyOverride('PlatformVersion', 'V2');

T152 must set lifecycleConfiguration.idleRuntimeSessionTimeout to 1800 s so the platform timer matches the 30-minute session cap the spec defines; the service default of 900 s would end a quiet visitor's session early.

Always confirm the deployed value rather than trusting the synth:

aws bedrock-agentcore-control get-agent-runtime \
  --agent-runtime-id <id> --query platformVersion

If it does not return V2 after a future deployment, the task records a CLI or AWS CLI fallback and requires recording the CloudFormation failure. That contingency does not resolve the constitutional ownership question. Do not document account IDs, ARNs containing account IDs, credentials or secret endpoints in the wiki.

After create/update, poll runtime status until it reaches a terminal or ready state. The infra plan notes that V2 operations can return while creation is still in progress; updating or deleting too early can conflict.

Frontend publish

After the stacks and runtime are deployed, copy the relevant stack outputs into the frontend environment file locally, then build and publish the static app:

cd packages/frontend
pnpm run build
aws s3 sync dist/ s3://<frontend-bucket>

Use placeholders in docs and handoffs. Real bucket names, distribution domains, credentials and account-specific ARNs do not belong in this public wiki.

Rollback posture

The quickstart documents a Lambda live alias for the WebSocket handler so a bad handler deploy can be rolled back by repointing the alias to a known-good version. Treat rollback commands as operational runbooks and keep any concrete resource identifiers out of wiki pages.

Before and after deployment

Run Guide-Validation-Gate before deployment. After deployment, verify the user-visible path rather than assuming stack success proves product success: frontend loads, the connection path works, and graceful failure states still show Max Height rather than a blank page.

Clone this wiki locally