I am using SSM send-command to start a Tomcat process on a Windows EC2 instance.
for example:
aws ssm send-command --instance-id i-xxxx --document-name "AWS-RunPowerShellScript"
--parameters 'commands=["startup.bat"]'
This does indeed start Tomcat but I noticed that SSM command invocation itself is stuck in progress until I eventually shut Tomcat down, at which point it immediately succeeds.
My hunch is that something about the way SSM runs Powershell blocks on any spawned child processes (start java ...
in the case of Tomcat). I don't think this is unique to Tomcat or even Java, though.
Is there a way I can get Powershell to exit, leaving the child processes running in the background?