Connection module for Amazon Autoscale Groups
New in version 2014.7.0.
This module accepts explicit autoscale credentials but can also utilize IAM roles assigned to the instance through Instance Profiles. Dynamic credentials are then automatically obtained from AWS API and no further configuration is necessary. More Information available at:
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html
If IAM roles are not used you need to specify them either in a pillar or in the minion's config file:
asg.keyid: GKTADJGHEIQSXMKKRBJ08H
asg.key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
A region may also be specified in the configuration:
asg.region: us-east-1
If a region is not specified, the default is us-east-1.
It's also possible to specify key, keyid and region via a profile, either as a passed in dict, or as a string to pull from pillars or minion config:
myprofile:
keyid: GKTADJGHEIQSXMKKRBJ08H
key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
region: us-east-1
boto
boto3
Create an autoscale group.
CLI Example:
salt myminion boto_asg.create myasg mylc '["us-east-1a", "us-east-1e"]' 1 10 load_balancers='["myelb", "myelb2"]' tags='[{"key": "Name", value="myasg", "propagate_at_launch": True}]'
Create a launch configuration.
CLI Example:
salt myminion boto_asg.create_launch_configuration mylc image_id=ami-0b9c9f62 key_name='mykey' security_groups='["mygroup"]' instance_type='c3.2xlarge'
Delete an autoscale group.
CLI Example:
salt myminion boto_asg.delete myasg region=us-east-1
Delete a launch configuration.
CLI Example:
salt myminion boto_asg.delete_launch_configuration mylc
Dump details of a given launch configuration.
CLI Example:
salt myminion boto_asg.describe_launch_configuration mylc
Switch desired instances to StandBy mode
New in version 2016.11.0.
CLI Example:
salt-call boto_asg.enter_standby my_autoscale_group_name '["i-xxxxxx"]'
Check to see if an autoscale group exists.
CLI Example:
salt myminion boto_asg.exists myasg region=us-east-1
Exit desired instances from StandBy mode
New in version 2016.11.0.
CLI Example:
salt-call boto_asg.exit_standby my_autoscale_group_name '["i-xxxxxx"]'
Return all AutoScale Groups visible in the account (as a list of boto.ec2.autoscale.group.AutoScalingGroup).
New in version 2016.11.0.
CLI Example:
salt-call boto_asg.get_all_groups region=us-east-1 --output yaml
Fetch and return all Launch Configuration with details.
CLI Example:
salt myminion boto_asg.get_all_launch_configurations
Get a mime multipart encoded string from a cloud-init dict. Currently supports boothooks, scripts and cloud-config.
CLI Example:
salt myminion boto.get_cloud_init_mime <cloud init>
Get the configuration for an autoscale group.
CLI Example:
salt myminion boto_asg.get_config myasg region=us-east-1
return attribute of all instances in the named autoscale group.
CLI Example:
salt-call boto_asg.get_instances my_autoscale_group_name
Return the arn for a scaling policy in a specific autoscale group or None if not found. Mainly used as a helper method for boto_cloudwatch_alarm, for linking alarms to scaling policies.
CLI Example:
salt '*' boto_asg.get_scaling_policy_arn mygroup mypolicy
Check for a launch configuration's existence.
CLI Example:
salt myminion boto_asg.launch_configuration_exists mylc
Return all AutoScale Groups visible in the account (as a list of names).
New in version 2016.11.0.
CLI Example:
salt-call boto_asg.list_groups region=us-east-1
List all Launch Configurations.
CLI Example:
salt myminion boto_asg.list_launch_configurations
Update an autoscale group.
CLI Example:
salt myminion boto_asg.update myasg mylc '["us-east-1a", "us-east-1e"]' 1 10 load_balancers='["myelb", "myelb2"]' tags='[{"key": "Name", value="myasg", "propagate_at_launch": True}]'