{"record":{"id":"d19680afc209694d","repo":"remotion-dev/remotion","slug":"parameter-vpcsubnetids-must-either-be-undefined","errorCode":null,"errorMessage":"parameter 'vpcSubnetIds' must either be 'undefined' or a comma-separated list of VPC subnet IDs string, but instead got: ${vpcSubnetIds}","messagePattern":"parameter 'vpcSubnetIds' must either be 'undefined' or a comma-separated list of VPC subnet IDs string, but instead got: (.+?)","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/lambda/src/shared/validate-vpc-subnet-ids.ts","lineNumber":17,"sourceCode":"const isValidVpcSubnetIdList = (vpcSubnetIds: string) => {\n\tconst subnetIdRegex = /^subnet-[0-9a-f]{17}$/;\n\tvpcSubnetIds.split(',').forEach((subnetId) => {\n\t\tif (!subnetIdRegex.test(subnetId.trim())) {\n\t\t\treturn false;\n\t\t}\n\t});\n\treturn true;\n};\n\nexport const validateVpcSubnetIds = (vpcSubnetIds: unknown) => {\n\tif (\n\t\ttypeof vpcSubnetIds !== 'undefined' &&\n\t\ttypeof vpcSubnetIds !== 'string' &&\n\t\t!isValidVpcSubnetIdList(vpcSubnetIds as string)\n\t) {\n\t\tthrow new TypeError(\n\t\t\t`parameter 'vpcSubnetIds' must either be 'undefined' or a comma-separated list of VPC subnet IDs string, but instead got: ${vpcSubnetIds}`,\n\t\t);\n\t}\n};\n","sourceCodeStart":1,"sourceCodeEnd":22,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/lambda/src/shared/validate-vpc-subnet-ids.ts#L1-L22","documentation":"Thrown by validateVpcSubnetIds() in @remotion/lambda when vpcSubnetIds is provided (not undefined) and is not a string. The argument must be a comma-separated string of AWS subnet IDs (e.g. 'subnet-0123456789abcdef0') or undefined. Same caveat as 1111: due to the guard short-circuiting on typeof !== 'string' and a forEach-return bug in isValidVpcSubnetIdList, malformed string IDs are NOT actually caught here; only non-string, non-undefined values are.","triggerScenarios":"Passing vpcSubnetIds as an array (['subnet-...']), object, number, or null to deployFunction(). Any string value passes the validation regardless of format.","commonSituations":"Passing an array because AWS SDKs and Terraform represent subnets as lists; passing null meaning 'no VPC'; misreading the docs and supplying an object with {subnets: [...]} structure.","solutions":["Pass a comma-separated string: vpcSubnetIds: 'subnet-aaaa...,subnet-bbbb...'.","Pass undefined when not deploying into a VPC.","Convert arrays: subnets.join(',')."],"exampleFix":"// before\nawait deployFunction({ vpcSubnetIds: ['subnet-0123456789abcdef0'] });\n\n// after\nawait deployFunction({ vpcSubnetIds: ['subnet-0123456789abcdef0'].join(',') });","handlingStrategy":"type-guard","validationCode":"function toVpcIds(v: unknown): string | undefined {\n  if (v === undefined || v === null) return undefined;\n  if (Array.isArray(v)) return v.filter(Boolean).join(',');\n  return typeof v === 'string' ? v : undefined;\n}","typeGuard":"const isOptionalSubnetIdString = (v: unknown): v is string | undefined =>\n  v === undefined || typeof v === 'string';","tryCatchPattern":null,"preventionTips":["Pass subnet IDs as a comma-separated string.","Omit / pass undefined when not using a VPC.","Validate the 'subnet-[0-9a-f]{17}' format yourself since the built-in helper does not."],"tags":["lambda","validation","vpc","aws","subnet","configuration","deploy"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}