Question

What is the exact behavior of the 'is_leader' flag on an Amazon Beanstalk deployment? I could not find any exhaustive documentation on it. More specifically:

  1. What is the value on a single instance environment?
  2. Does Amazon properly reset the is_leader value when nodes are added/removed from an environment, either manually or via auto-scaling?
  3. If that flag is automatically reset by Amazon for a node, does Amazon take care of restarting the instance to make sure that flag is taken into account by the application?
Was it helpful?

Solution

is_leader is a tag, applied by AWS deployment process to the first created instance. As you mentioned, the documentation on is_leader is very scarce, here's what I was able to find:

The idea of a leader only exists during the execution of a deployment in an environment update. After deployment has executed, there isn't a concept of a leader anymore, though you could determine which instance had been the leader if needed for debugging purposes.

The answers to your questions:

What is the value on a single instance environment?

is_leader is not applicable to single instance environment, so the tag is not set.

Does Amazon properly reset the is_leader value when nodes are added/removed from an environment, either manually or via auto-scaling?

Leader node is not immune from being removed from an environment. If it's removed, there's no "leader" re-assignment. There are ways to prevent it from being shut down by AutoScaling: Configure Instance Termination Policy for Your Auto Scaling Group

If that flag is automatically reset by Amazon for a node, does Amazon take care of restarting the instance to make sure that flag is taken into account by the application?

The flag is not reset. Once the leader node is gone from the environment, the tag will only reappear on the rebuild.

Sources:

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top