Created
July 16, 2011 17:45
-
-
Save numan/1086584 to your computer and use it in GitHub Desktop.
Setting up a scaling policy using boto
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
#For a complete list of options see http://boto.cloudhackers.com/ref/ec2.html#boto.ec2.autoscale.policy.ScalingPolicy | |
scalingUpPolicy = ScalingPolicy(name='webserverScaleUpPolicy', | |
adjustment_type='ChangeInCapacity', | |
as_name='webserver-asg', | |
scaling_adjustment=2, | |
cooldown=180) | |
scalingDownPolicy = ScalingPolicy(name='webserverScaleDownPolicy', | |
adjustment_type='ChangeInCapacity', | |
as_name='webserver-asg', | |
scaling_adjustment=-1, | |
cooldown=180) | |
conn_as.create_scaling_policy(scalingUpPolicy) | |
conn_as.create_scaling_policy(scalingDownPolicy) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment