{"record":{"id":"e06d93624408cfc9","repo":"remotion-dev/remotion","slug":"parameter-vpcsecuritygroupids-must-either-be-un","errorCode":null,"errorMessage":"parameter 'vpcSecurityGroupIds' must either be 'undefined' or a comma-separated list of VPC security group IDs string, but instead got: ${vpcSecurityGroupIds}","messagePattern":"parameter 'vpcSecurityGroupIds' must either be 'undefined' or a comma-separated list of VPC security group IDs string, but instead got: (.+?)","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/lambda/src/shared/validate-vpc-security-group-ids.ts","lineNumber":17,"sourceCode":"const isValidVpcSecurityGroupIdList = (vpcSecurityGroupIds: string) => {\n\tconst securityGroupIdRegex = /^sg-[0-9a-f]{17}$/;\n\tvpcSecurityGroupIds.split(',').forEach((securityGroupId) => {\n\t\tif (!securityGroupIdRegex.test(securityGroupId.trim())) {\n\t\t\treturn false;\n\t\t}\n\t});\n\treturn true;\n};\n\nexport const validateVpcSecurityGroupIds = (vpcSecurityGroupIds: unknown) => {\n\tif (\n\t\ttypeof vpcSecurityGroupIds !== 'undefined' &&\n\t\ttypeof vpcSecurityGroupIds !== 'string' &&\n\t\t!isValidVpcSecurityGroupIdList(vpcSecurityGroupIds as string)\n\t) {\n\t\tthrow new TypeError(\n\t\t\t`parameter 'vpcSecurityGroupIds' must either be 'undefined' or a comma-separated list of VPC security group IDs string, but instead got: ${vpcSecurityGroupIds}`,\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-security-group-ids.ts#L1-L22","documentation":"Thrown by validateVpcSecurityGroupIds() in @remotion/lambda when vpcSecurityGroupIds is provided (not undefined) and is not a string. The argument must be a comma-separated string of AWS security group IDs (e.g. 'sg-0123456789abcdef0') or undefined. Important caveat: due to the boolean structure of the guard (typeof !== 'string' short-circuits the regex helper) and a forEach bug in isValidVpcSecurityGroupIdList (return false inside the arrow does not stop iteration), malformed-but-string IDs do NOT trigger this error; only non-string, non-undefined values do.","triggerScenarios":"Passing vpcSecurityGroupIds as an array (['sg-...']), an object, a number, or null to deployFunction(). Passing a string always passes validation regardless of format.","commonSituations":"Treating the option as an array because VPC config in AWS SDKs typically uses arrays; passing null intending 'no VPC'; reading from a YAML config that parses a single value as a non-string.","solutions":["Pass a comma-separated string: vpcSecurityGroupIds: 'sg-aaaa...,sg-bbbb...'.","Pass undefined (or omit) when not using a VPC.","Convert arrays before calling: ids.join(',')."],"exampleFix":"// before\nawait deployFunction({ vpcSecurityGroupIds: ['sg-0123456789abcdef0', 'sg-fedcba9876543210'] });\n\n// after\nawait deployFunction({ vpcSecurityGroupIds: ['sg-0123456789abcdef0', 'sg-fedcba9876543210'].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 isOptionalVpcIdString = (v: unknown): v is string | undefined =>\n  v === undefined || typeof v === 'string';","tryCatchPattern":null,"preventionTips":["Pass VPC IDs as a single comma-separated string, not an array.","Use undefined (omit) when not deploying into a VPC.","Be aware the validator does not catch malformed-but-string IDs; format them yourself."],"tags":["lambda","validation","vpc","aws","security-group","configuration","deploy"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}