From 059f972c9b9e675629aeaadc43ee105da54ae0f3 Mon Sep 17 00:00:00 2001 From: Tao <104055472+teowa@users.noreply.github.com> Date: Wed, 24 May 2023 17:06:49 +0800 Subject: [PATCH] add locks for delete --- .../appconfiguration/app_configuration_replica_resource.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/services/appconfiguration/app_configuration_replica_resource.go b/internal/services/appconfiguration/app_configuration_replica_resource.go index d7a12da437801..98ea70a2f5114 100644 --- a/internal/services/appconfiguration/app_configuration_replica_resource.go +++ b/internal/services/appconfiguration/app_configuration_replica_resource.go @@ -164,6 +164,9 @@ func (r ReplicaResource) Delete() sdk.ResourceFunc { return err } + locks.ByName(id.ConfigurationStoreName, r.ResourceType()) + defer locks.UnlockByName(id.ConfigurationStoreName, r.ResourceType()) + if err = client.DeleteThenPoll(ctx, *id); err != nil { return fmt.Errorf("deleting %s: %+v", *id, err) }