aws / res

Research and Engineering Studio (RES) is an AWS supported open source product that enables IT administrators to provide an easy-to-use web portal for scientists and engineers to run technical computing workloads on AWS.
https://github.com/aws/res
Apache License 2.0
79 stars 15 forks source link

Stop bastion hosts to minimise cost #54

Open patryk-madej opened 1 month ago

patryk-madej commented 1 month ago

Is your feature request related to a problem? Please describe. Currently, bastion hosts are running by default, even though they are used only as needed. This generates unnecessary costs, especially if RES is deployed across several different environments/accounts.

Describe the solution you'd like Bastion hosts should ideally be stopped after RES deployment and have a simple CRON job to stop them at night, as they're unlikely to be used then. For example:

echo '#!/bin/bash
INSTANCE_ID=$(curl -s http://169.254.169.254/latest/meta-data/instance-id)
aws ec2 stop-instances --instance-ids $INSTANCE_ID' > stop_self.sh
chmod +x stop_self.sh

crontab -e
0 0 * * * /path/to/stop_self.sh

Describe alternatives you've considered n/a

Additional context n/a

Tygen commented 1 month ago

Hey there,

Thanks for bringing this up. We're aware of the issue with bastion hosts not auto-stopping, and it's definitely on our roadmap as a feature to add.

Unfortunately, I can't give you an exact timeline on when it'll be released just yet. But we'll make sure to mention it in our release notes once it's ready to go.

Keep an eye out for those, and we'll have that functionality implemented soon enough.

Thanks!