We have an EC2 instance which we are using as a bastion host. We use this to sometimes get a production console but mostly as an entry point for a data transfer tool (Census) to migrate some of our database from RDS to an external warehouse.
We noticed our EC2 instance would shut down randomly throughout the day. So installed the cloudwatch agent so we could monitor more metrics. The machine was not running out of memory, CPU or disk. So I went to check the logs are there were no errors happening when the machine shut down. The user session would just be stopped.
So to test a theory I got a production console which would just print something out to the console every 15 seconds. This completely stopped the machine from going down.
The instance is running an ubuntu image.
Has anyone experienced any similar problems or have any advice? I can provide more details if needed.