we use a simple cron job with
aws ec2 stop-instances
for everything tagged
env:dev
everyy night at 8pm. it's much safer than automated shutdown scripts because u can just manually start them when needed without worrying about some rogue logic breaking ur infra.