Created
August 4, 2016 14:51
-
-
Save seventhskye/c818f10ba60cec77696754062cab891a to your computer and use it in GitHub Desktop.
A script to detect all the instances in an autoscaling group and assign one as the master.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import sys | |
import boto3 | |
def main(argv): | |
autoscaling = boto3.client('autoscaling') | |
auto_scaling_groups = autoscaling.describe_auto_scaling_groups()['AutoScalingGroups'] | |
for asg in auto_scaling_groups: | |
break | |
if __name__ == "__main__": | |
main(sys.argv) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment