OpenStdin (Console.Read, etc...) with AWS ECS

"interactive" parameter in the ECS task definition

If you use AWS ECS to deploy a container that uses openStdin, such as Console.Read() in C#, to keep the application alive, make sure "interactive" parameter in the ECS task definition is set to "true".


Otherwise, your container in ECS will keep on exiting itself consistently with Exit Code 0 (zero).
It behaves differently if you run it on docker engine, i.e. not specifying "interactive" flag will still keep the container running. But ECS will take it down if "interactive" is not set to true when you are using stdin as a mean to keep the application alive.

The other option is to let the main thread sleep infinitely if you don't want to use stdin.