Skip to content

Determine a leader instance in AWS autoscaling group.

Notifications You must be signed in to change notification settings

ragnarkurmwunder/aws-leader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Determine a leader in AWS Autoscaling group

This script determines which instance is a leader in an autoscaling group.

It does not communicate between instances to establish an agreement nor uses locking.

Leader is established by having alphabetically first instance ID in sorted instance ID list.

Usage

./aws-leader.py
  • Exit code 0 - current instance is a leader
  • Exit code 1 - current instance is not a leader

Install

  1. Download the script and place it to /usr/local/bin/aws-leader.py
  2. Give it execution rights chmod 755 /usr/local/bin/aws-leader.py

When running into trouble with missing Python libs:

$ sudo pip install botocore boto3 awscli --upgrade

Note that upgrading system awscli is needed, because it is dependent botocore which will be upgraded and awscli conflicts with new botocore which is needed for boto3.

About

Determine a leader instance in AWS autoscaling group.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages