0

I have some instances in AWS which I need only one of them, no scaling. Of course we monitor those instances as well, but before alerting someone. I checked if there's a way in AWS to check for the instance on a regular basis and terminate and spawn by itself.

I was wondering if a cron on the box that will check for my minimal requirements to consider the box working properly, and if the check doesn't pass then push an alert in cloudwatch then take action from there.

Is this the right way to do it ? Should I put it anyway in ASG ? Not sure what is the best way to do so here, thanks for any hint.

1 Answer 1

2

The right way is to use an Elastic Load Balancer with a properly-configured Health Check, and then put your instance in an Auto Scaling Group, configured to use the ELB health check to determine the health of the instance.

The ELB will Access the instance via the network every 30 seconds or so (configurable). If the instance is unreachable or otherwise unhealthy, it will be terminated and replaced.

5
  • Just to make sure as I need only one of those box, in my AS configuration I put desired 1 min 1 max 1 ?
    – Kangt_qc
    Aug 21, 2018 at 17:16
  • @Kangt_qc yes if there is only one instance needed. Aug 21, 2018 at 19:04
  • I expected that if there's more than one running while my max is at 1, then once instance would be shutdown. But it doesn't seem the case ... did I miss something in my config, or this isn't the behaviour ?
    – Kangt_qc
    Aug 22, 2018 at 14:11
  • @Kangt_qc Do you have a load balancer? Do you have the ASG linked to the load balancer? Do you have the ASG health check configured for ELB? Aug 22, 2018 at 15:43
  • Yes I have all of that but the first instance wasnt launch by the group that's why :) It's all good thanks !
    – Kangt_qc
    Aug 22, 2018 at 19:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .