diff --git a/internal/services/springcloud/spring_cloud_gateway_route_config_resource.go b/internal/services/springcloud/spring_cloud_gateway_route_config_resource.go index 7ec5cb22a5e5..fb975c1189ea 100644 --- a/internal/services/springcloud/spring_cloud_gateway_route_config_resource.go +++ b/internal/services/springcloud/spring_cloud_gateway_route_config_resource.go @@ -215,14 +215,23 @@ func resourceSpringCloudGatewayRouteConfigCreateUpdate(d *pluginsdk.ResourceData gatewayRouteConfigResource := appplatform.GatewayRouteConfigResource{ Properties: &appplatform.GatewayRouteConfigProperties{ AppResourceID: utils.String(d.Get("spring_cloud_app_id").(string)), - Filters: utils.ExpandStringSlice(d.Get("filters").(*pluginsdk.Set).List()), - Predicates: utils.ExpandStringSlice(d.Get("predicates").(*pluginsdk.Set).List()), Protocol: appplatform.GatewayRouteConfigProtocol(d.Get("protocol").(string)), Routes: expandGatewayRouteConfigGatewayAPIRouteArray(d.Get("route").(*pluginsdk.Set).List()), SsoEnabled: utils.Bool(d.Get("sso_validation_enabled").(bool)), OpenAPI: expandGatewayRouteConfigOpenApi(d.Get("open_api").([]interface{})), }, } + + filters := d.Get("filters").(*pluginsdk.Set).List() + if len(filters) > 0 { + gatewayRouteConfigResource.Properties.Filters = utils.ExpandStringSlice(filters) + } + + predicates := d.Get("predicates").(*pluginsdk.Set).List() + if len(predicates) > 0 { + gatewayRouteConfigResource.Properties.Predicates = utils.ExpandStringSlice(predicates) + } + future, err := client.CreateOrUpdate(ctx, id.ResourceGroup, id.SpringName, id.GatewayName, id.RouteConfigName, gatewayRouteConfigResource) if err != nil { return fmt.Errorf("creating/updating %s: %+v", id, err)