{"record":{"id":"ddb7e8bea649ddfb","repo":"heygen-com/hyperframes","slug":"lambda-stack-opts-stackname-is-missing-one-of","errorCode":null,"errorMessage":"[lambda] stack ${opts.stackName} is missing one of RenderBucketName/RenderFunctionArn/RenderStateMachineArn. Got keys: ${[...byKey.keys()].join(\", \")}","messagePattern":"\\[lambda\\] stack (.+?) is missing one of RenderBucketName/RenderFunctionArn/RenderStateMachineArn\\. Got keys: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/cli/src/commands/lambda/sam.ts","lineNumber":178,"sourceCode":"    opts.stackName,\n    \"--region\",\n    opts.region,\n    \"--query\",\n    \"Stacks[0].Outputs\",\n    \"--output\",\n    \"json\",\n  ];\n  if (opts.awsProfile) {\n    args.unshift(\"--profile\", opts.awsProfile);\n  }\n  const out = execFileSync(\"aws\", args, { encoding: \"utf-8\" });\n  const parsed = JSON.parse(out) as { OutputKey: string; OutputValue: string }[];\n  const byKey = new Map(parsed.map((o) => [o.OutputKey, o.OutputValue]));\n  const bucketName = byKey.get(\"RenderBucketName\");\n  const functionName = byKey.get(\"RenderFunctionArn\");\n  const stateMachineArn = byKey.get(\"RenderStateMachineArn\");\n  if (!bucketName || !functionName || !stateMachineArn) {\n    throw new Error(\n      `[lambda] stack ${opts.stackName} is missing one of RenderBucketName/RenderFunctionArn/RenderStateMachineArn. Got keys: ${[...byKey.keys()].join(\", \")}`,\n    );\n  }\n  return {\n    bucketName,\n    // RenderFunctionArn is the full ARN; the Lambda function name is the\n    // last colon-segment, which downstream `getRenderProgress` calls use\n    // for cost math + CloudWatch lookups.\n    functionName: functionName.split(\":\").pop() ?? functionName,\n    stateMachineArn,\n  };\n}\n","sourceCodeStart":160,"sourceCodeEnd":191,"githubUrl":"https://github.com/heygen-com/hyperframes/blob/c2996c8626135db5253519359d8a063d3bafad8d/packages/cli/src/commands/lambda/sam.ts#L160-L191","documentation":"Thrown by fetchStackOutputs() in packages/cli/src/commands/lambda/sam.ts:177. After deploy, it queries `aws cloudformation describe-stacks` and expects three specific outputs: RenderBucketName, RenderFunctionArn, RenderStateMachineArn. If any is missing (or empty) it throws, listing the keys actually present so you can see what the stack exported instead.","triggerScenarios":"fetchStackOutputs against a stack whose template doesn't export those three outputs — e.g. an older template revision, a user-customized template that renamed/removed outputs, a partial deploy, or pointing --stack-name at the wrong stack.","commonSituations":"Template version mismatch (deployed an older examples/aws-lambda/template.yaml that lacks the outputs); user edited outputs in a forked template; querying a stack created by a different tool; CloudFormation deploy partially succeeded and outputs weren't all materialized.","solutions":["Inspect the printed 'Got keys:' list — if the three expected keys are absent or renamed, the deployed template differs from what HyperFrames expects.","Redeploy from the current examples/aws-lambda/template.yaml (the one matching your CLI version).","Verify --stack-name points at the HyperFrames render stack, not the SAM managed-default stack or an unrelated app.","Run `aws cloudformation describe-stacks --stack-name <name> --query 'Stacks[0].Outputs'` manually to compare."],"exampleFix":"# inspect actual outputs\naws cloudformation describe-stacks --stack-name <name> --region us-east-1 \\\n  --query 'Stacks[0].Outputs' --output table\n# then redeploy from the matching template if outputs are missing","handlingStrategy":"validation","validationCode":"import { execFileSync } from 'node:child_process';\n\nconst REQUIRED_OUTPUTS = ['RenderBucketName', 'RenderFunctionArn', 'RenderStateMachineArn'];\n\nfunction stackHasRequiredOutputs(name: string, region: string): boolean {\n  const out = execFileSync('aws', [\n    'cloudformation', 'describe-stacks', '--stack-name', name,\n    '--region', region, '--query', 'Stacks[0].Outputs', '--output', 'json',\n  ], { encoding: 'utf-8' });\n  const keys = new Set((JSON.parse(out) as { OutputKey: string }[]).map((o) => o.OutputKey));\n  return REQUIRED_OUTPUTS.every((k) => keys.has(k));\n}","typeGuard":null,"tryCatchPattern":"try {\n  fetchStackOutputs(opts);\n} catch (error) {\n  if (/is missing one of/.test(String(error))) {\n    // re-run describe-stacks, inspect actual keys, redeploy from matching template\n    throw new Error('Deployed template is missing expected outputs — redeploy from the current template.yaml');\n  }\n  throw error;\n}","preventionTips":["Keep the deployed examples/aws-lambda/template.yaml in lockstep with the CLI version.","Assert the three required outputs in a post-deploy smoke test before proceeding.","Don't fork-rename the outputs; if customizing, alias them back to the expected names."],"tags":["aws","cloudformation","lambda","deployment"],"backgroundTag":null,"analyzedSha":"c2996c8626135db5253519359d8a063d3bafad8d","analyzedAt":"2026-08-12T22:18:56.877Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}