From b6cc18c1b7184cd7ff2378686a02d6d58f4f2748 Mon Sep 17 00:00:00 2001 From: Matthew Date: Tue, 19 Sep 2023 13:17:02 -0700 Subject: [PATCH] ForceNew when expiration_date is removed from the config --- internal/services/keyvault/key_vault_key_resource.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/internal/services/keyvault/key_vault_key_resource.go b/internal/services/keyvault/key_vault_key_resource.go index 4eafbaba1e65..610ef37eccee 100644 --- a/internal/services/keyvault/key_vault_key_resource.go +++ b/internal/services/keyvault/key_vault_key_resource.go @@ -256,6 +256,12 @@ func resourceKeyVaultKey() *pluginsdk.Resource { "tags": tags.Schema(), }, + + CustomizeDiff: pluginsdk.CustomDiffWithAll( + pluginsdk.ForceNewIfChange("expiration_date", func(ctx context.Context, old, new, meta interface{}) bool { + return old.(string) != "" && new.(string) == "" + }), + ), } }