Skip to content

Drift on warm throughput #112

@xnick123

Description

@xnick123

Description

When using DynamoDB tables with Global Secondary Indexes (GSIs) in PAY_PER_REQUEST billing mode, AWS automatically adjusts the warm_throughput values (read_units_per_second and write_units_per_second) based on usage patterns as documented in AWS DynamoDB warm throughput documentation. This causes perpetual Terraform drift where the module detects changes to GSI configuration even though no intentional changes were made to the Terraform code.

According to AWS: "Warm throughput values are available by default for all tables and GSIs at no cost" and "DynamoDB will automatically adjust warm throughput values as your usage increases." These are AWS-managed default values that appear automatically without user intervention or cost.

The module correctly supports passing read_units_per_second and write_units_per_second parameters to GSIs via the warm_throughput block, but there's no way to ignore AWS-managed drift on these specific attributes while still allowing intentional changes to other GSI properties when using PAY_PER_REQUEST billing mode. If this is intentional, please close.

  • ✋ I have searched the open/closed issues and my issue is not listed.

Versions

  • Module version: 5.3.0
  • Terraform version: 1.14.1
  • Provider version(s): hashicorp/aws 6.24

Reproduction Code

Image

Steps to reproduce

  1. Deploy the table with the configuration above
  2. Wait for AWS to automatically adjust warm throughput values (happens within hours/days based on usage)
  3. Run terraform plan
  4. Observe perpetual drift showing GSI wants to be recreated due to warm throughput differences

Expected behavior

The module should provide a way to ignore AWS-managed warm throughput adjustments while still allowing intentional changes to other GSI attributes. E.g. through:

  • A variable like ignore_warm_throughput_drift = true

Actual behavior

Terraform plan shows:

Image

This creates a perpetual diff that requires either:

  1. Constantly updating Terraform code to match AWS values
  2. Ignoring the entire global_secondary_index block with lifecycle rules (not possible in module calls)
  3. Living with perpetual drift warnings

Proposed Solution

The module already has an ignore_changes_global_secondary_index variable that creates a separate resource (autoscaled_gsi_ignore) with lifecycle rules. However, this only works when autoscaling_enabled = true and ignores ALL GSI changes (too broad).

Suggested approach:

  1. Add a new variable: ignore_warm_throughput_changes = false
  2. Create a fourth resource variant (similar to autoscaled_gsi_ignore) that:
    • Works with autoscaling_enabled = false (PAY_PER_REQUEST mode)
    • Has a lifecycle block that specifically ignores only the warm_throughput attribute changes in global secondary indexes and at the table level, while still detecting changes to other GSI properties.

Additional context

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions