New in Terraform: Manage global secondary index drift in Amazon DynamoDB
Database Blog
This article introduces Terraform's new experimental `aws_dynamodb_global_secondary_index` resource for managing DynamoDB GSI drift independently from table configuration.
- New resource treats each GSI as independent with separate lifecycle management
- Enables selective `ignore_changes` for specific GSI attributes, not all-or-nothing
- Solves drift detection issues when capacity adjusted outside Terraform
- Requires environment variable `TF_AWS_EXPERIMENT_dynamodb_global_secondary_index=1`
- Supports granular control: ignore capacity changes while detecting schema modifications
- Full support for warm throughput configuration on on-demand tables
- Migration uses `terraform import` with zero downtime; cannot mix with traditional nested blocks
- Experimental feature; schema may change; test in non-production first
The new resource provides better infrastructure governance by allowing operational capacity adjustments while maintaining drift detection for critical GSI changes like deletions or schema modifications.
The AWS News Feed is currently looking for gold sponsors. If you want to support the AWS community and reach a large audience of AWS professionals, consider sponsoring the AWS News Feed.
Related articles
2025
2026
2026
2025
The AWS News Feed is currently looking for silver sponsors. If you want to support the AWS community and reach a large audience of AWS professionals, consider sponsoring the AWS News Feed.