From cfdfd8fbf7154016426cbdf953cc92a443d936e5 Mon Sep 17 00:00:00 2001 From: akinross Date: Thu, 31 Oct 2024 15:35:42 +0100 Subject: [PATCH] [bugfix] Fix fex and micro_seg_vlan attributes in resource_mso_schema_site_anp_epg_bulk_staticport to be correctly set when index shift occur in teh static_ports list --- ...source_mso_schema_site_anp_epg_bulk_staticport.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/mso/resource_mso_schema_site_anp_epg_bulk_staticport.go b/mso/resource_mso_schema_site_anp_epg_bulk_staticport.go index 3aba5575..579f4243 100644 --- a/mso/resource_mso_schema_site_anp_epg_bulk_staticport.go +++ b/mso/resource_mso_schema_site_anp_epg_bulk_staticport.go @@ -101,15 +101,19 @@ func resourceMSOSchemaSiteAnpEpgBulkStaticPort() *schema.Resource { }, false), }, "fex": { - Type: schema.TypeString, - Optional: true, - Computed: true, + Type: schema.TypeString, + Optional: true, + // Remove computed because when a user updates the list and causes index shifts + // the fex state value will be used at the location of the list index when not provided in config. + // Computed: true, ValidateFunc: validation.StringIsNotEmpty, }, "micro_seg_vlan": { Type: schema.TypeInt, Optional: true, - Computed: true, + // Remove computed because when a user updates the list and causes index shifts + // the micro_seg_vlan state value will be used at the location of the list index when not provided in config. + // Computed: true, }, "mode": { Type: schema.TypeString,