I've configured automatic shutdown as follows:
Automatic shutdown EC2 instances will be automatically terminated 300 seconds after the agent goes offline
However after a build, the instance remained running for over an hour and I had to manually stop it.
Am I missign anything?