Skip to content

Commit

Permalink
Merge pull request #39784 from hashicorp/b-dynamodb_table_odt
Browse files Browse the repository at this point in the history
r/aws_dynamodb_table: ignore go default value when expanding `on_demand_throughput`
  • Loading branch information
johnsonaj authored Oct 18, 2024
2 parents defdafe + de99abb commit 3fc7ac2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .changelog/39784.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
resource/aws_dynamodb_table: Fix validation error when optional attribute in `on_demand_throughput` is excluded
```
4 changes: 2 additions & 2 deletions internal/service/dynamodb/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -2436,11 +2436,11 @@ func expandOnDemandThroughput(tfMap map[string]interface{}) *awstypes.OnDemandTh

apiObject := &awstypes.OnDemandThroughput{}

if v, ok := tfMap["max_read_request_units"].(int); ok {
if v, ok := tfMap["max_read_request_units"].(int); ok && v != 0 {
apiObject.MaxReadRequestUnits = aws.Int64(int64(v))
}

if v, ok := tfMap["max_write_request_units"].(int); ok {
if v, ok := tfMap["max_write_request_units"].(int); ok && v != 0 {
apiObject.MaxWriteRequestUnits = aws.Int64(int64(v))
}

Expand Down

0 comments on commit 3fc7ac2

Please sign in to comment.