Skip to content

Commit e79235f

Browse files
committed
fix: restore APP_ACCESS_KEY_ID/SECRET to env: block — DynamoDB/Bedrock broken
Amplify WEB_COMPUTE does NOT reliably inject env vars into Lambda runtime. Removing APP_* credentials from the env: block in Phase 1 caused: - DynamoDB: all operations fail (auth sessions, feed, sync) - Bedrock: chat falls back to offline mode - Auth: sessions lost on refresh (DynamoDB lookup fails → memory fallback) These are server-only vars (no NEXT_PUBLIC_ prefix) — baked into the server bundle only, never sent to the browser. Same pattern as GOOGLE_CLIENT_SECRET.
1 parent 1adfbc5 commit e79235f

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

next.config.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,12 @@ const nextConfig: NextConfig = {
3838
DYNAMODB_SESSION_SUMMARIES_TABLE: process.env.DYNAMODB_SESSION_SUMMARIES_TABLE ?? "",
3939
DYNAMODB_FEED_POSTS_TABLE: process.env.DYNAMODB_FEED_POSTS_TABLE ?? "",
4040
APP_REGION: process.env.APP_REGION ?? "",
41-
// SECURITY: APP_ACCESS_KEY_ID, APP_SECRET_ACCESS_KEY are NOT baked here —
42-
// read at runtime via process.env (Lambda IAM role or APP_* env vars).
43-
// GOOGLE_CLIENT_SECRET is baked because Amplify WEB_COMPUTE does not
44-
// reliably inject branch-level env vars into the Lambda runtime.
41+
// Amplify WEB_COMPUTE does not reliably inject env vars into the Lambda
42+
// runtime — all vars needed at request time must be baked at build time.
43+
// These are server-only (no NEXT_PUBLIC_ prefix) so they stay in the
44+
// server bundle and are never sent to the browser.
45+
APP_ACCESS_KEY_ID: process.env.APP_ACCESS_KEY_ID ?? "",
46+
APP_SECRET_ACCESS_KEY: process.env.APP_SECRET_ACCESS_KEY ?? "",
4547
},
4648

4749
// Security + COOP/COEP headers (SharedArrayBuffer for ONNX WASM)

0 commit comments

Comments
 (0)