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
salt.modules.boto_asg.
create
(name, launch_config_name, availability_zones, min_size, max_size, desired_capacity=None, load_balancers=None, default_cooldown=None, health_check_type=None, health_check_period=None, placement_group=None, vpc_zone_identifier=None, tags=None, termination_policies=None, suspended_processes=None, scaling_policies=None, scheduled_actions=None, region=None, notification_arn=None, notification_types=None, key=None, keyid=None, profile=None)¶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}]'
salt.modules.boto_asg.
create_launch_configuration
(name, image_id, key_name=None, vpc_id=None, vpc_name=None, security_groups=None, user_data=None, instance_type='m1.small', kernel_id=None, ramdisk_id=None, block_device_mappings=None, instance_monitoring=False, spot_price=None, instance_profile_name=None, ebs_optimized=False, associate_public_ip_address=None, volume_type=None, delete_on_termination=True, iops=None, use_block_device_types=False, region=None, key=None, keyid=None, profile=None)¶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'
salt.modules.boto_asg.
delete
(name, force=False, region=None, key=None, keyid=None, profile=None)¶Delete an autoscale group.
CLI example:
salt myminion boto_asg.delete myasg region=us-east-1
salt.modules.boto_asg.
delete_launch_configuration
(name, region=None, key=None, keyid=None, profile=None)¶Delete a launch configuration.
CLI example:
salt myminion boto_asg.delete_launch_configuration mylc
salt.modules.boto_asg.
describe_launch_configuration
(name, region=None, key=None, keyid=None, profile=None)¶Dump details of a given launch configuration.
CLI example:
salt myminion boto_asg.describe_launch_configuration mylc
salt.modules.boto_asg.
enter_standby
(name, instance_ids, should_decrement_desired_capacity=False, region=None, key=None, keyid=None, profile=None)¶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"]'
salt.modules.boto_asg.
exists
(name, region=None, key=None, keyid=None, profile=None)¶Check to see if an autoscale group exists.
CLI example:
salt myminion boto_asg.exists myasg region=us-east-1
salt.modules.boto_asg.
exit_standby
(name, instance_ids, should_decrement_desired_capacity=False, region=None, key=None, keyid=None, profile=None)¶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"]'
salt.modules.boto_asg.
get_all_groups
(region=None, key=None, keyid=None, profile=None)¶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
salt.modules.boto_asg.
get_all_launch_configurations
(region=None, key=None, keyid=None, profile=None)¶Fetch and return all Launch Configuration with details.
CLI example:
salt myminion boto_asg.get_all_launch_configurations
salt.modules.boto_asg.
get_cloud_init_mime
(cloud_init)¶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>
salt.modules.boto_asg.
get_config
(name, region=None, key=None, keyid=None, profile=None)¶Get the configuration for an autoscale group.
CLI example:
salt myminion boto_asg.get_config myasg region=us-east-1
salt.modules.boto_asg.
get_instances
(name, lifecycle_state='InService', health_status='Healthy', attribute='private_ip_address', attributes=None, region=None, key=None, keyid=None, profile=None)¶return attribute of all instances in the named autoscale group.
CLI example:
salt-call boto_asg.get_instances my_autoscale_group_name
salt.modules.boto_asg.
get_scaling_policy_arn
(as_group, scaling_policy_name, region=None, key=None, keyid=None, profile=None)¶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
salt.modules.boto_asg.
launch_configuration_exists
(name, region=None, key=None, keyid=None, profile=None)¶Check for a launch configuration's existence.
CLI example:
salt myminion boto_asg.launch_configuration_exists mylc
salt.modules.boto_asg.
list_groups
(region=None, key=None, keyid=None, profile=None)¶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
salt.modules.boto_asg.
list_launch_configurations
(region=None, key=None, keyid=None, profile=None)¶List all Launch Configurations.
CLI example:
salt myminion boto_asg.list_launch_configurations
salt.modules.boto_asg.
update
(name, launch_config_name, availability_zones, min_size, max_size, desired_capacity=None, load_balancers=None, default_cooldown=None, health_check_type=None, health_check_period=None, placement_group=None, vpc_zone_identifier=None, tags=None, termination_policies=None, suspended_processes=None, scaling_policies=None, scheduled_actions=None, notification_arn=None, notification_types=None, region=None, key=None, keyid=None, profile=None)¶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}]'