Skip to content

Guide Deployment

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

Guide: Deployment

Deployment is split on purpose:

  • 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 moves into CDK (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 retired. 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:

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 and is deployed by CDK, with the rest of the infrastructure.

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 platform version is set with an L1 escape hatch and must be 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');

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, fall back to agentcore deploy or the AWS CLI control-plane operation with --platform-version V2, using placeholders for project-specific values. 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