From c3023ab74fe34c8c8b20513e614ea347f18f9e06 Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 27 Dec 2024 22:44:48 +0000 Subject: [PATCH] updating network_features back to computed=true --- internal/services/netapp/README.md | 20 ++++++++++++++++++- .../netapp_volume_group_oracle_resource.go | 1 + .../services/netapp/netapp_volume_resource.go | 1 + 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/internal/services/netapp/README.md b/internal/services/netapp/README.md index a3daaf3b1e18..85a2cce45839 100644 --- a/internal/services/netapp/README.md +++ b/internal/services/netapp/README.md @@ -120,4 +120,22 @@ backupPolicyIdRemoval := volumes.VolumePatch{ }, }, } -``` \ No newline at end of file +``` + +## `Computed` attribute of a few configuration items + +- Azure NetApp Files resources are complex enough on the backend and a few configuration items must remain in `computed = true` state and not changed under any circumstance, otherwise, if it is a `ForceNew = true` type of configuration, it may result in data loss. The best example of this is the configuration called `network_features`, this must be `computed = true` at all times, Azure NetApp Files team will soon make changes to networking that will make the property `network_features` be changed from `basic` to `standard` and to prevent data loss, this configuration should stay as is, with `computed = true` set. + +```golang +"network_features": { + Type: pluginsdk.TypeString, + Optional: true, + Computed: true, + Default: string(volumes.NetworkFeaturesBasic), + ValidateFunc: validation.StringInSlice([]string{ + string(volumes.NetworkFeaturesBasic), + string(volumes.NetworkFeaturesStandard), + }, false), +}, +``` + diff --git a/internal/services/netapp/netapp_volume_group_oracle_resource.go b/internal/services/netapp/netapp_volume_group_oracle_resource.go index 5c38626fc069..c0b3ec5cc0d8 100644 --- a/internal/services/netapp/netapp_volume_group_oracle_resource.go +++ b/internal/services/netapp/netapp_volume_group_oracle_resource.go @@ -274,6 +274,7 @@ func (r NetAppVolumeGroupOracleResource) Arguments() map[string]*pluginsdk.Schem Type: pluginsdk.TypeString, Optional: true, Default: "Basic", + Computed: true, ValidateFunc: validation.StringInSlice(volumegroups.PossibleValuesForNetworkFeatures(), false), }, }, diff --git a/internal/services/netapp/netapp_volume_resource.go b/internal/services/netapp/netapp_volume_resource.go index cd8a623c7ec3..ee1620b03bf5 100644 --- a/internal/services/netapp/netapp_volume_resource.go +++ b/internal/services/netapp/netapp_volume_resource.go @@ -111,6 +111,7 @@ func resourceNetAppVolume() *pluginsdk.Resource { "network_features": { Type: pluginsdk.TypeString, Optional: true, + Computed: true, Default: string(volumes.NetworkFeaturesBasic), ValidateFunc: validation.StringInSlice([]string{ string(volumes.NetworkFeaturesBasic),