Live data from Hacker News

Show HN: Tiny CLI to save AWS costs in dev environments when you're sleeping

npmjs.com

51–56 of 56 posts

Re: Show HN: Tiny CLI to save AWS costs in dev environments when you're sleeping

#51
post #23

Just published a tiny CLI utility to save some bucks on AWS development environment while I'm not really working. https://github.com/aramalipoor/aws-cost-saver The idea is to stop/shutdown any resources (such as EC2 instances, RDS databases, ECS tasks, etc.) when you're done for the day and restore them back up next time you continue. Currently it's in a very early stage, a hobby side-project :) Ideally I'm thinking…

Im very interested in learning about your work flows, like how does a typical day look like? I do all my work on a local pc and only use servers for production. So im interesting in how/why you use the cloud stack

It really depends on the company and developers preferences. For our company's case we do have a "dev" AWS environment for a couple of reasons:

1) To avoid having a side-IaC for your dev env (e.g. using docker-compose/local k8s/localstack) which could take same time as your prod-IaC (terraform/CloudFormation) to prepare. Instead of hours preparing/debugging local dev we can work on great features or refactoring some tech-debt in the real code.

2) Since we have many other teams and upstream dependencies it's much easier to deploy on a AWS when testing complicated features. In an ideal world you shouldn't need it but unfortunately it's never ideal world.

3) Local dev solutions could easily end up with "but it worked on my laptop" due to various reasons from Docker host configs, to localstack deviations from real AWS resources, etc.

But at the end of the day you should see what makes more sense for you :) I guess for many people spending time on preparing a great local dev using docker-compose/k8s/swarm/localstack is cheaper than using AWS for dev anyway.

Re: Show HN: Tiny CLI to save AWS costs in dev environments when you're sleeping

#52
post #39
post #25

Earlier quoted context omitted.

How do you test or develop against cloud resources like ECS using a local PC?

I would like to know how and why you use resources like ECS. et.al. There reason why I do not like to use cloud/serverless is because I find debugging is much easier on a local computer or a server I have root/metal/hardware access to. And that serverless have a very slow iteration rate, it can take minutes just to run a simple test that would be instant locally. The reason I'm asking is because on my free time I'm d…

Posted an answer to another similar question: https://news.ycombinator.com/item?id=24250329 hope it helps when developing with your IDE :)

Re: Show HN: Tiny CLI to save AWS costs in dev environments when you're sleeping

#53
post #20

Is it common to have a dev environment on AWS? I just use it for production and maybe staging. Staging is scheduled to run during office hours.

It’s super useful to be able to spin up a dev environment for doing things like experimenting with the performance impact of different configs. It’d be annoying and potentially disruptive to other team members to do that on staging.

Re: Show HN: Tiny CLI to save AWS costs in dev environments when you're sleeping

#54
post #32

If you're using IaC and have it set up in a CI/CD pipeline, you could also achieve the same by having a cronjob set a flag outside of work hours, and use conditionals in your IaC based on the value of that flag (e.g., for Terraform `count = var.scale_down ? 0 : 1`)

There were a few reasons why I couldn't use IaC:

1) Using conditionals to achieve this usually makes terraform unmanageable specially if your terraform is complex.

2) Sometimes you'd need to do more complex steps to save some money, for example in case of ElastiCache you'd need to snapshot/delete/create.

3) Using terraform in a Lambda to schedule this was not straightforward (in my current company) so I gave up making it work :D

Re: Show HN: Tiny CLI to save AWS costs in dev environments when you're sleeping

#55
post #15

aws has a instance scheduler as a solution that achieves some of this objectives https://aws.amazon.com/solutions/implementations/instance-sc...

That's a good alternative for EC2 / RDS instances but when it comes to other cases like DynamoDB provisioned throughput or Kinesis shards or ElastiCache it wouldn't help much
Post reply on HN