diff --git a/internal/service/memorydb/multi_region_cluster.go b/internal/service/memorydb/multi_region_cluster.go index 126e114d0d7..12e46d086d5 100644 --- a/internal/service/memorydb/multi_region_cluster.go +++ b/internal/service/memorydb/multi_region_cluster.go @@ -370,10 +370,10 @@ func (r *multiRegionClusterResource) Delete(ctx context.Context, req resource.De // Before deleting the multi-region cluster, ensure it is ready for deletion. // Removing an `aws_memorydb_cluster` from a multi-region cluster may temporarily block deletion. output, err := findMultiRegionClusterByName(ctx, conn, state.ID.ValueString()) + if tfresource.NotFound(err) { + return + } if err != nil { - if tfresource.NotFound(err) { - return - } resp.Diagnostics.AddError( create.ProblemStandardMessage(names.MemoryDB, create.ErrActionDeleting, ResNameMultiRegionCluster, state.ID.String(), err), err.Error(),