File tree Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,15 @@ locals {
2121 from_index = length (var. range_key ) > 0 ? 0 : 1
2222
2323 attributes_final = slice (local. attributes , local. from_index , length (local. attributes ))
24+
25+ ignore_changes_list = var. ignore_gsi_changes ? [
26+ " read_capacity" ,
27+ " write_capacity" ,
28+ " global_secondary_index"
29+ ] : [
30+ " read_capacity" ,
31+ " write_capacity"
32+ ]
2433}
2534
2635resource "null_resource" "global_secondary_index_names" {
@@ -68,10 +77,7 @@ resource "aws_dynamodb_table" "default" {
6877 }
6978
7079 lifecycle {
71- ignore_changes = [
72- read_capacity ,
73- write_capacity
74- ]
80+ ignore_changes = local. ignore_changes_list
7581 }
7682
7783 dynamic "attribute" {
Original file line number Diff line number Diff line change @@ -208,3 +208,9 @@ variable "import_table" {
208208 default = null
209209 description = " Import Amazon S3 data into a new table."
210210}
211+
212+ variable "ignore_gsi_changes" {
213+ description = " Whether to ignore changes to global_secondary_index"
214+ type = bool
215+ default = false
216+ }
You can’t perform that action at this time.
0 commit comments