From e83dc88b6e44885d8925beff5d8a8f70e521fa69 Mon Sep 17 00:00:00 2001 From: Shion Ichikawa Date: Tue, 28 Jan 2025 08:33:37 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Always=20specify=20"name"=20for?= =?UTF-8?q?=20GlobalSecondaryIndex=20in=20flattenTableGlobalSecondaryIndex?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Resolves #41110 (`aws_dynamodb_table` GSI shows unexpected diffs when using DynamoDB local emulator) --- internal/service/dynamodb/table.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/service/dynamodb/table.go b/internal/service/dynamodb/table.go index 307d7afb21b1..d00271da0ef3 100644 --- a/internal/service/dynamodb/table.go +++ b/internal/service/dynamodb/table.go @@ -2127,10 +2127,11 @@ func flattenTableGlobalSecondaryIndex(gsi []awstypes.GlobalSecondaryIndexDescrip for _, g := range gsi { gsi := make(map[string]interface{}) + gsi[names.AttrName] = aws.ToString(g.IndexName) + if g.ProvisionedThroughput != nil { gsi["write_capacity"] = aws.ToInt64(g.ProvisionedThroughput.WriteCapacityUnits) gsi["read_capacity"] = aws.ToInt64(g.ProvisionedThroughput.ReadCapacityUnits) - gsi[names.AttrName] = aws.ToString(g.IndexName) } for _, attribute := range g.KeySchema {