Skip to content

Instantly share code, notes, and snippets.

@numan
Created July 16, 2011 17:45
Show Gist options
  • Save numan/1086584 to your computer and use it in GitHub Desktop.
Save numan/1086584 to your computer and use it in GitHub Desktop.
Setting up a scaling policy using boto
#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