Fail gracefully in ec2_asg
module when there are no matching launch configurations
This commit is contained in:
parent
06e1141106
commit
5dd9372ff8
1 changed files with 2 additions and 0 deletions
|
@ -442,6 +442,8 @@ def create_autoscaling_group(connection, module):
|
|||
availability_zones = module.params['availability_zones'] = [zone.name for zone in ec2_connection.get_all_zones()]
|
||||
enforce_required_arguments(module)
|
||||
launch_configs = connection.get_all_launch_configurations(names=[launch_config_name])
|
||||
if len(launch_configs) == 0:
|
||||
module.fail_json(msg="No launch config found with name %s" % launch_config_name)
|
||||
ag = AutoScalingGroup(
|
||||
group_name=group_name,
|
||||
load_balancers=load_balancers,
|
||||
|
|
Loading…
Reference in a new issue