Skip to content

Commit

Permalink
fix(userconfig): plan doesn't show zero values for new resources
Browse files Browse the repository at this point in the history
  • Loading branch information
byashimov committed Dec 12, 2024
1 parent 08c8a97 commit a49d291
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ nav_order: 1
- Add `alloydbomni` BETA resource and datasource
- Add `aiven_alloydbomni_user` BETA resource and datasource
- Add `aiven_alloydbomni_database` BETA resource and datasource
- Fix `terraform plan`: new resources don't display zero values for user configuration options

## [4.30.0] - 2024-12-05

Expand Down
5 changes: 5 additions & 0 deletions internal/sdkprovider/userconfig/diff/diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ var (
// SuppressUnchanged suppresses diff for unchanged fields.
// Applied for all nested values: both for objects and arrays.
func SuppressUnchanged(k, oldValue, newValue string, d *schema.ResourceData) bool {
if d.Id() == "" {
// Do not suppress diff for new resources.
return false
}

// schema.TypeMap
if strings.HasSuffix(k, ".%") {
return oldValue == newValue
Expand Down

0 comments on commit a49d291

Please sign in to comment.