in src/aws/autoscaling.ts [14:24]
export function detachInstance(instance: Instance, asgName: string): Promise<DetachInstancesCommandOutput> {
console.log(`Detaching ${instance.id} from ${asgName}. This should also bring a new instance into the ASG`);
const params = {
InstanceIds: [ instance.id ],
AutoScalingGroupName: asgName,
ShouldDecrementDesiredCapacity: false
};
const req = new DetachInstancesCommand(params);
return retry(() => awsAutoscaling.send(req), `detaching instance ${instance.id}`, 5)
}