Skip to content

Commit 8801ec6

Browse files
Eshan Vaidravinitp
authored andcommitted
Bug Fix Update current_version_number on secret_content update
1 parent 0fc9196 commit 8801ec6

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

internal/service/vault/vault_secret_resource.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ import (
1111
"strings"
1212
"time"
1313

14+
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/customdiff"
15+
1416
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
1517
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"
1618

@@ -260,6 +262,11 @@ func VaultSecretResource() *schema.Resource {
260262
Computed: true,
261263
},
262264
},
265+
CustomizeDiff: customdiff.All(
266+
customdiff.ComputedIf("current_version_number", func(_ context.Context, diff *schema.ResourceDiff, meta interface{}) bool {
267+
return diff.HasChange("secret_content")
268+
}),
269+
),
263270
}
264271
}
265272

0 commit comments

Comments
 (0)