Skip to content

Commit

Permalink
docs: Mention ignore_changes_global_secondary_index can cause table t…
Browse files Browse the repository at this point in the history
…o be recreated (#83)
  • Loading branch information
mnylensc authored Feb 9, 2024
1 parent 715399d commit 6f55029
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ is an [open issue for this on the AWS Provider](https://github.com/hashicorp/ter
the `ignore_changes_global_secondary_index` setting however, using this setting means that any changes to GSIs will be ignored by Terraform and will
hence have to be applied manually (or via some other automation).

**NOTE**: Setting `ignore_changes_global_secondary_index` after the table is already created causes your table to be recreated. In this case, you will
need to move the old `aws_dynamodb_table` resource that is being `destroyed` to the new resource that is being `created`. For example:

```
terraform state mv module.dynamodb_table.aws_dynamodb_table.autoscaled module.dynamodb_table.aws_dynamodb_table.autoscaled_ignore_gsi
```

## Module wrappers

Users of this Terraform module can create multiple similar resources by using [`for_each` meta-argument within `module` block](https://www.terraform.io/language/meta-arguments/for_each) which became available in Terraform 0.13.
Expand Down

0 comments on commit 6f55029

Please sign in to comment.