Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions internal/services/keyvault/key_vault_secret_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,16 @@ func resourceKeyVaultSecret() *pluginsdk.Resource {

"tags": tags.SchemaWithMax(15),
},

CustomizeDiff: pluginsdk.CustomDiffWithAll(
pluginsdk.ForceNewIfChange("expiration_date", func(ctx context.Context, oldVal, newVal interface{}, meta interface{}) bool {
// if change from non-nil to nil, we need to force new
if oldVal != nil && oldVal.(string) != "" {
return newVal == nil || newVal.(string) == ""
}
return false
}),
),
}
}

Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/key_vault_secret.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ The following arguments are supported:

* `not_before_date` - (Optional) Key not usable before the provided UTC datetime (Y-m-d'T'H:M:S'Z').

* `expiration_date` - (Optional) Expiration UTC datetime (Y-m-d'T'H:M:S'Z').
* `expiration_date` - (Optional) Expiration UTC datetime (Y-m-d'T'H:M:S'Z'). Removing this forces a new resource to be created.

## Attributes Reference

Expand Down
Loading