Orchestration - AWS EC2 closes abruptly

Hello, I have implemented a program on my local machine and connected to AWS to execute the UiPth project.
When the job executes remotely on (as a part of project execution) AWS EC2 windows machine, the RDP connection gets disconnected abruptly, again I have to reconnect and to see the result. On re-connection, it runs fine and again RDP connectivity crashes. Can you please tell me why the disconnection is happening.