private StackStatus WaitForStackDeleted(StackStatus status, string stackName) { while (status == StackStatus.DELETE_IN_PROGRESS) { var stack = _cloudFormationClient.ListStacks().StackSummaries.First(s => s.StackName == stackName); status = stack.StackStatus; if (status == StackStatus.DELETE_IN_PROGRESS) Thread.Sleep(TimeSpan.FromSeconds(10)); } return status; }