I'm new to AWS. I'm writing a console application that will be long running on a Windows EC2 instance. The application starts up and does a Console.ReadLine()
it runs a long running background task.
What I'd like to do is do some clean up work when the EC2 instance is shut down. Is there any way to set up EC2 to send a new line command to the console application and then wait to get an application exit code before continuing the shutdown so my application can finish whatever work it is doing and shutdown gracefully?