Ref T2015. If you attempt to close a "Pending Allocation" resource in Drydock for an EC2 resource, and that resource was a spot request, currently you are unable to close the resource because the TerminateInstance call fails (because there is no instance).
Instead, only call TerminateInstance if there is an instance ID, and use CancelSpotInstanceRequests if a spot request ID is present. Closing pending allocation resources should only be done if the daemons were interrupted during allocation, and the resources need to be manually cleaned up or closed.