Stale endpoint naming issues may occur when shutting down and restarting the server instance from the AWS Management Console due to AWS changing the hostname of the instance.
It is possible to turn off this server name change feature using the EC2Config tool which is installed on the server instance:
In this tool, uncheck "Set Computer Name" in the General tab and click OK:
For Windows 2016 Server, EC2Config has been replaced by EC2Launch. Review the EC2Launch documentation for instructions on how to change the computer name for EC2 instances on Windows 2016 Server.