Skip to content

Kinesis streams should have an adequate data retention period

This control checks whether an Amazon Kinesis data stream has a data retention period greater than or equal to the specified time frame. The control fails if the data retention period is less than the specified time frame. Unless you provide a custom parameter value for the data retention period, Security Hub uses a default value of 168 hours.

How to fix

Attribute retention_period of aws_kinesis_stream must be non-empty.

Implementation options

Choose the option that matches how you manage Terraform. All options satisfy this control.

Option 1: Terraform AWS provider resources

If you manage resources directly, configure the relevant Terraform AWS provider resources to meet this control. See docs for the resources involved: aws_kinesis_stream.

resource "aws_kinesis_stream" "this" {
  encryption_type  = "KMS"
  kms_key_id       = "arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012"
  name             = "pofix-example-stream"
  retention_period = 168
  shard_count      = 1
}
Which option should I choose?
  • Compliance.tf module (recommended): controls enforced by default and mapped to frameworks.
  • Open source module (terraform-aws-modules): compatible by design with compliance.tf. Same variable names for an easy, low-change migration path when you are ready.
  • Terraform AWS provider resources: manage Terraform resources directly.

Tool mappings

Use these identifiers to cross-reference this control across tools, reports, and evidence.

  • Compliance.tf (CTF) Control: kinesis_stream_retention_period_168_hours

  • AWS Config Managed Rule: KINESIS_STREAM_BACKUP_RETENTION_CHECK

  • Powerpipe Control: aws_compliance.control.kinesis_stream_retention_period_168_hours