简体   繁体   中英

AWS deregister an instance from cli and register back

Issue ->

We have few nodes that are in a asg and fronted by an alb. We have many target group. in some cases, we have some nodes in two or more different target groups. When we update our software, we need to deregister them from all the target group that node is associated to avoid any downtime. since it is error prone and time consuming method. we are planning to create a script (place it in all the nodes) which can identify the target group that node is associated and an option to register/deregister. when we are making any update, we can simply deregister the node from the target group and once the maintenance is completed, we can register it back.

Question ->

  1. Any aws expert let us know if this can be done via a bash script (if so, how to proceed with it) and what are the potential issues we might get into?

  2. In addition to that, Is there any other way to suspend traffic to a node in alb other than deregistering the node in target group

Thanks in Advance.

  1. Yes. It can be done with the help AWS cli. Potential issue can be if you do not store the target group and the port that the node belongs to. you will lose such details after deregistering. therefore, when creating the script, make sure to store those details, it can be used to register the node back to the same target groups.

  2. No.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM