Skip to main content
LOWKinesisReliability

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

  1. 1Increase RetentionPeriodHours to support replay/reprocessing during incidents
FlaggedThe stream keeps the default 24-hour retention, leaving no room to replay or reprocess records after a longer outage.
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,
});
FixedExtending retention to 72 hours provides a multi-day window to replay records during recovery.
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::Stream

AWS documentation

Read the AWS guidance

Intentional? 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 scan

CDK Insights runs this and 118+ other rules locally against your synthesised CDK app — free, no account, your code never leaves your machine.

More Kinesis rules