{"record":{"id":"585ec7a7ecd44a82","repo":"anomalyco/sst","slug":"provisioned-concurrency-requires-function-versioni","errorCode":null,"errorMessage":"Provisioned concurrency requires function versioning. Set \"versioning: true\" to enable function versioning.","messagePattern":"Provisioned concurrency requires function versioning\\. Set \"versioning: true\" to enable function versioning\\.","errorType":"validation","errorClass":"VisibleError","httpStatus":null,"severity":"error","filePath":"platform/src/components/aws/function.ts","lineNumber":2905,"sourceCode":"                \",\",\n              ),\n            ),\n          },\n          { parent },\n        );\n        return url.route.routerUrl;\n      });\n    }\n\n    function createProvisioned() {\n      return all([args.concurrency, fn.publish]).apply(\n        ([concurrency, publish]) => {\n          if (!concurrency?.provisioned || concurrency.provisioned === 0) {\n            return;\n          }\n\n          if (publish !== true) {\n            throw new VisibleError(\n              `Provisioned concurrency requires function versioning. Set \"versioning: true\" to enable function versioning.`,\n            );\n          }\n\n          return new lambda.ProvisionedConcurrencyConfig(\n            `${name}Provisioned`,\n            {\n              functionName: fn.name,\n              qualifier: fn.version,\n              provisionedConcurrentExecutions: concurrency.provisioned,\n            },\n            { parent },\n          );\n        },\n      );\n    }\n\n    function createEventInvokeConfig() {","sourceCodeStart":2887,"sourceCodeEnd":2923,"githubUrl":"https://github.com/anomalyco/sst/blob/a0bd20f762883e72a35caccb4896c42ce5b3f707/platform/src/components/aws/function.ts#L2887-L2923","documentation":"Provisioned concurrency in AWS Lambda requires a published Lambda version to attach to. The Function constructor checks `concurrency.provisioned` against `versioning`/`publish` and throws this VisibleError when provisioned concurrency is configured but versioning is disabled.","triggerScenarios":"new sst.aws.Function(\"Fn\", { concurrency: { provisioned: 5 } }) without versioning: true (or publish: true) in the args.","commonSituations":"Adding provisioned concurrency to an existing function to eliminate cold starts while leaving versioning off; copy-pasting concurrency snippets from docs that assume versioning is enabled.","solutions":["Add versioning: true to the Function args","If using an alias in front of the function, point it at the versioned function"],"exampleFix":"// before\nnew sst.aws.Function(\"Fn\", { concurrency: { provisioned: 5 } });\n// after\nnew sst.aws.Function(\"Fn\", { versioning: true, concurrency: { provisioned: 5 } });","handlingStrategy":"validation","validationCode":"if (args.concurrency?.provisioned && args.concurrency.provisioned > 0 && args.versioning !== true)\n  throw new Error(\"versioning: true is required for provisioned concurrency\");","typeGuard":null,"tryCatchPattern":"try {\n  new sst.aws.Function(\"Fn\", args);\n} catch (e) {\n  if ((e as Error).message.includes(\"Provisioned concurrency requires\")) {\n    console.error(\"Enable versioning: true\");\n  }\n  throw e;\n}","preventionTips":["Whenever adding provisioned concurrency, also set versioning: true","Review concurrency settings after copying configs between functions"],"tags":["aws","lambda","provisioned-concurrency","versioning","config-requirement"],"backgroundTag":"provisioned-concurrency-requires-versioning","analyzedSha":"a0bd20f762883e72a35caccb4896c42ce5b3f707","analyzedAt":"2026-08-30T11:26:00.383Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}