0

I have a fairly common (and functioning) Opsworks stack with an ELB, auto-scaling app servers, and a database. Trouble is, 99% of the time I just need one app server and don't need the ELB, yet I'm still paying for it. I'm looking for an easy way to turn off the ELB when it's not needed.

I think I need two scripts: one to delete the ELB and point my Route 53 domain to the single app server, and one to launch an ELB, hook it up to the app servers, and re-point my Route 53 domain to the ELB. (The good news is that I know precisely when I'll need more app servers, so I don't need to automatically detect when there are multiple app servers.)

I know enough about AWS to build my Opsworks stack with Chef scripts, but I'm very new to the AWS CLI. Is there an easy way to accomplish this? Do scripts like this already exist? Thanks!

ScottyB
  • 113
  • 3
  • How much is your time worth? An ELB costs $15/month. Chances are just leaving it there will be more cost-effective than building and managing something to do all this. – ceejayoz Jun 14 '18 at 19:33
  • I realize it doesn't cost very much, but I was hoping there might be an easy solution that I wouldn't have to spend a lot of time on. Thanks. – ScottyB Jun 14 '18 at 19:41
  • This isn't commonly done. If you do this you probably need to change DNS to point at the instance, wait for DNS caches to change, then turn off ELB. In theory DNS should change within 5 minutes or so, but a small number of DNS servers cache everything for 24 hours even with low TTL, so if you delete the ELB immediately some users won't have access to your site / application. – Tim Jun 14 '18 at 20:46
  • 1
    So you don't need the balancer for TLS offload, DDoS protection, or optimizing reuse of application server connections by multiple clients? – Michael - sqlbot Jun 14 '18 at 22:57
  • @Michael-sqlbot, the application has very little traffic except for planned spikes when I need the load balancer. Just hoping there was an easy way to temporarily turn off the ELB when it only gets about 10 hits per day, then re-instate it when needed. Sounds like it's not common nor recommended! In fact, there doesn't appear to be a way to 'stop' an ELB like an EC2, so I would have to 'delete' it and configure a new ELB to make work... Thanks. – ScottyB Jun 18 '18 at 18:16

0 Answers0