Skip to content

Instantly share code, notes, and snippets.

@moki9
Forked from numan/sp_boto.py
Last active August 29, 2015 14:15
Show Gist options
  • Save moki9/8de8ea9c415f7ac8930c to your computer and use it in GitHub Desktop.
Save moki9/8de8ea9c415f7ac8930c to your computer and use it in GitHub Desktop.
#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