Kinesis Minimum Retention
kinesis-retention-minimum
What this rule checks
Detects Kinesis Data Streams using the default 24-hour retention period.
How to fix it
- 1Increase RetentionPeriodHours to support replay/reprocessing during incidents
import { Stack, App } from 'aws-cdk-lib';
import { Construct } from 'constructs';
import * as kinesis from 'aws-cdk-lib/aws-kinesis';
new kinesis.Stream(this, 'Stream', {
shardCount: 1,
});import { Stack, App, Duration } from 'aws-cdk-lib';
import { Construct } from 'constructs';
import * as kinesis from 'aws-cdk-lib/aws-kinesis';
new kinesis.Stream(this, 'Stream', {
shardCount: 1,
retentionPeriod: Duration.hours(72),
});CDK Insights pinpoints the exact file and line in your CDK source for every finding, so you can jump straight to the fix.
Affected resource types
AWS::Kinesis::StreamIntentional? Suppress this finding
Sometimes a flag is deliberate — a genuinely public endpoint, say. You can dismiss kinesis-retention-minimum and the reason is kept in the report, not silently hidden.
In .cdk-insights.json:
{
"ignoreRules": [
{ "id": "kinesis-retention-minimum", "reason": "Why this is intentional" }
]
}Or inline in your CDK code:
Validations.of(scope).acknowledge({
id: 'cdk-insights::kinesis-retention-minimum',
reason: 'Why this is intentional',
});Use the rule ID kinesis-retention-minimum shown above — not the CDK-* ID from SARIF / GitHub code scanning. To dismiss every finding on one construct instead, use ignorePaths. Suppression docs →
Catch this in your stack
$ npx cdk-insights scanCDK Insights runs this and 118+ other rules locally against your synthesised CDK app — free, no account, your code never leaves your machine.