{"record":{"id":"53d4303ae493c05a","repo":"remotion-dev/remotion","slug":"cloudwatch-retention-period-must-be-at-most-max","errorCode":null,"errorMessage":"CloudWatch retention period must be at most ${MAX_RETENTION_PERIOD}, but is ${period}","messagePattern":"CloudWatch retention period must be at most (.+?), but is (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/lambda/src/shared/validate-retention-period.ts","lineNumber":42,"sourceCode":"\t\tthrow new TypeError(\n\t\t\t`CloudWatch retention period must be finite, but is ${period}`,\n\t\t);\n\t}\n\n\tif (period % 1 !== 0) {\n\t\tthrow new TypeError(\n\t\t\t`CloudWatch retention period must be an integer, but is ${period}`,\n\t\t);\n\t}\n\n\tif (period < MIN_RETENTION_PERIOD) {\n\t\tthrow new Error(\n\t\t\t`CloudWatch retention period must be at least ${MIN_RETENTION_PERIOD}, but is ${period}`,\n\t\t);\n\t}\n\n\tif (period > MAX_RETENTION_PERIOD) {\n\t\tthrow new Error(\n\t\t\t`CloudWatch retention period must be at most ${MAX_RETENTION_PERIOD}, but is ${period}`,\n\t\t);\n\t}\n};\n","sourceCodeStart":24,"sourceCodeEnd":47,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/lambda/src/shared/validate-retention-period.ts#L24-L47","documentation":"Thrown by validateCloudWatchRetentionPeriod() (an Error) when the integer value exceeds the maximum of 3650 days (10 * 365). Remotion caps retention at 10 years, below CloudWatch's own hard limit, for sane log management.","triggerScenarios":"Passing a large integer such as 1000000; defaulting to a 'very large' sentinel intending 'keep forever'.","commonSituations":"Misunderstanding the cap; passing the raw CloudWatch maximum; computing retention from an over-large formula.","solutions":["Pass an integer between 1 and 3650 inclusive.","Use 3650 if you want the longest supported retention.","Validate the upper bound in config before calling deployFunction."],"exampleFix":"// before\ndeployFunction({region, cloudWatchLogRetentionPeriodInDays: 1000000})\n// after\ndeployFunction({region, cloudWatchLogRetentionPeriodInDays: 3650})","handlingStrategy":"validation","validationCode":"const MAX = 3650\nif (typeof period === 'number' && period > MAX) {\n  throw new Error(`retention must be <= ${MAX}`)\n}","typeGuard":"const isRetentionInRange = (v: unknown): v is number =>\n  typeof v === 'number' && Number.isInteger(v) && v >= 1 && v <= 3650","tryCatchPattern":null,"preventionTips":["Cap retention at 3650 in config validation.","Use 3650 explicitly when 'longest supported' is desired.","Reject oversized sentinels at the config boundary."],"tags":["aws","cloudwatch","validation","configuration"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}