Skip to content

Commit 6f55029

Browse files
authored
docs: Mention ignore_changes_global_secondary_index can cause table to be recreated (#83)
1 parent 715399d commit 6f55029

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,13 @@ is an [open issue for this on the AWS Provider](https://github.com/hashicorp/ter
4242
the `ignore_changes_global_secondary_index` setting however, using this setting means that any changes to GSIs will be ignored by Terraform and will
4343
hence have to be applied manually (or via some other automation).
4444

45+
**NOTE**: Setting `ignore_changes_global_secondary_index` after the table is already created causes your table to be recreated. In this case, you will
46+
need to move the old `aws_dynamodb_table` resource that is being `destroyed` to the new resource that is being `created`. For example:
47+
48+
```
49+
terraform state mv module.dynamodb_table.aws_dynamodb_table.autoscaled module.dynamodb_table.aws_dynamodb_table.autoscaled_ignore_gsi
50+
```
51+
4552
## Module wrappers
4653

4754
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.

0 commit comments

Comments
 (0)