diff --git a/gen/definitions/generic/security_policy.yaml b/gen/definitions/generic/security_policy.yaml index 9f768425..b32197fc 100644 --- a/gen/definitions/generic/security_policy.yaml +++ b/gen/definitions/generic/security_policy.yaml @@ -5,6 +5,7 @@ get_rest_endpoint: /template/policy/security/definition/ has_version: true id_from_query_path: data id_from_query_path_attribute: policyId +get_before_delete: true delete_mutex: true doc_category: (Classic) Security Policies attributes: diff --git a/internal/provider/resource_sdwan_security_policy.go b/internal/provider/resource_sdwan_security_policy.go index 10fcae02..a23018dd 100644 --- a/internal/provider/resource_sdwan_security_policy.go +++ b/internal/provider/resource_sdwan_security_policy.go @@ -330,6 +330,7 @@ func (r *SecurityPolicyResource) Delete(ctx context.Context, req resource.Delete tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Delete", state.Name.ValueString())) + _, _ = r.client.Get(state.getPath()) r.updateMutex.Lock() res, err := r.client.Delete(state.getPath() + url.QueryEscape(state.Id.ValueString())) r.updateMutex.Unlock()