From 63bd85452170fce4a1e288f78100ff4521989a7d Mon Sep 17 00:00:00 2001 From: Mark Chappell Date: Fri, 1 Jul 2022 16:08:13 +0200 Subject: [PATCH 1/4] Rename AutoScaling group modules --- meta/runtime.yml | 40 +++++++++++++++++++ .../{ec2_asg.py => autoscaling_group.py} | 0 ..._asg_info.py => autoscaling_group_info.py} | 0 ...esh.py => autoscaling_instance_refresh.py} | 0 ...y => autoscaling_instance_refresh_info.py} | 0 ...ec2_lc.py => autoscaling_launch_config.py} | 0 ...d.py => autoscaling_launch_config_find.py} | 0 ...o.py => autoscaling_launch_config_info.py} | 0 ..._hook.py => autoscaling_lifecycle_hook.py} | 0 ...caling_policy.py => autoscaling_policy.py} | 0 ...ion.py => autoscaling_scheduled_action.py} | 0 .../{ec2_asg => autoscaling_group}/aliases | 2 +- .../{ec2_asg => autoscaling_group}/inventory | 0 .../{ec2_asg => autoscaling_group}/main.yml | 0 .../meta/main.yml | 0 .../roles/ec2_asg/defaults/main.yml | 0 .../ec2_asg/tasks/create_update_delete.yml | 0 .../roles/ec2_asg/tasks/env_cleanup.yml | 0 .../roles/ec2_asg/tasks/env_setup.yml | 0 .../roles/ec2_asg/tasks/instance_detach.yml | 0 .../roles/ec2_asg/tasks/main.yml | 0 .../roles/ec2_asg/tasks/tag_operations.yml | 0 .../{ec2_asg => autoscaling_group}/runme.sh | 0 .../autoscaling_instance_refresh/aliases | 2 + .../defaults/main.yml | 0 .../meta/main.yml | 0 .../tasks/main.yml | 0 .../tasks/refresh_and_cancel_three_times.yml | 0 .../vars/main.yml | 0 .../targets/autoscaling_launch_config/aliases | 4 ++ .../defaults/main.yml | 0 .../meta/main.yml | 0 .../tasks/env_cleanup.yml | 0 .../tasks/env_setup.yml | 0 .../tasks/main.yml | 0 .../vars}/main.yml | 0 .../aliases | 0 .../inventory | 0 .../main.yml | 0 .../meta/main.yml | 0 .../ec2_asg_lifecycle_hook/defaults/main.yml | 0 .../tasks/create_update_delete.yml | 0 .../tasks/env_cleanup.yml | 0 .../tasks/env_setup.yml | 0 .../ec2_asg_lifecycle_hook/tasks/main.yml | 0 .../runme.sh | 0 .../aliases | 0 .../defaults}/main.yml | 0 .../meta/main.yml | 0 .../tasks/main.yml | 0 .../targets/ec2_asg_instance_refresh/aliases | 2 - tests/integration/targets/ec2_lc/aliases | 4 -- 52 files changed, 47 insertions(+), 7 deletions(-) rename plugins/modules/{ec2_asg.py => autoscaling_group.py} (100%) rename plugins/modules/{ec2_asg_info.py => autoscaling_group_info.py} (100%) rename plugins/modules/{ec2_asg_instance_refresh.py => autoscaling_instance_refresh.py} (100%) rename plugins/modules/{ec2_asg_instance_refresh_info.py => autoscaling_instance_refresh_info.py} (100%) rename plugins/modules/{ec2_lc.py => autoscaling_launch_config.py} (100%) rename plugins/modules/{ec2_lc_find.py => autoscaling_launch_config_find.py} (100%) rename plugins/modules/{ec2_lc_info.py => autoscaling_launch_config_info.py} (100%) rename plugins/modules/{ec2_asg_lifecycle_hook.py => autoscaling_lifecycle_hook.py} (100%) rename plugins/modules/{ec2_scaling_policy.py => autoscaling_policy.py} (100%) rename plugins/modules/{ec2_asg_scheduled_action.py => autoscaling_scheduled_action.py} (100%) rename tests/integration/targets/{ec2_asg => autoscaling_group}/aliases (73%) rename tests/integration/targets/{ec2_asg => autoscaling_group}/inventory (100%) rename tests/integration/targets/{ec2_asg => autoscaling_group}/main.yml (100%) rename tests/integration/targets/{ec2_asg => autoscaling_group}/meta/main.yml (100%) rename tests/integration/targets/{ec2_asg => autoscaling_group}/roles/ec2_asg/defaults/main.yml (100%) rename tests/integration/targets/{ec2_asg => autoscaling_group}/roles/ec2_asg/tasks/create_update_delete.yml (100%) rename tests/integration/targets/{ec2_asg => autoscaling_group}/roles/ec2_asg/tasks/env_cleanup.yml (100%) rename tests/integration/targets/{ec2_asg => autoscaling_group}/roles/ec2_asg/tasks/env_setup.yml (100%) rename tests/integration/targets/{ec2_asg => autoscaling_group}/roles/ec2_asg/tasks/instance_detach.yml (100%) rename tests/integration/targets/{ec2_asg => autoscaling_group}/roles/ec2_asg/tasks/main.yml (100%) rename tests/integration/targets/{ec2_asg => autoscaling_group}/roles/ec2_asg/tasks/tag_operations.yml (100%) rename tests/integration/targets/{ec2_asg => autoscaling_group}/runme.sh (100%) create mode 100644 tests/integration/targets/autoscaling_instance_refresh/aliases rename tests/integration/targets/{ec2_asg_instance_refresh => autoscaling_instance_refresh}/defaults/main.yml (100%) rename tests/integration/targets/{ec2_asg_instance_refresh => autoscaling_instance_refresh}/meta/main.yml (100%) rename tests/integration/targets/{ec2_asg_instance_refresh => autoscaling_instance_refresh}/tasks/main.yml (100%) rename tests/integration/targets/{ec2_asg_instance_refresh => autoscaling_instance_refresh}/tasks/refresh_and_cancel_three_times.yml (100%) rename tests/integration/targets/{ec2_asg_instance_refresh => autoscaling_instance_refresh}/vars/main.yml (100%) create mode 100644 tests/integration/targets/autoscaling_launch_config/aliases rename tests/integration/targets/{ec2_lc => autoscaling_launch_config}/defaults/main.yml (100%) rename tests/integration/targets/{ec2_lc => autoscaling_launch_config}/meta/main.yml (100%) rename tests/integration/targets/{ec2_lc => autoscaling_launch_config}/tasks/env_cleanup.yml (100%) rename tests/integration/targets/{ec2_lc => autoscaling_launch_config}/tasks/env_setup.yml (100%) rename tests/integration/targets/{ec2_lc => autoscaling_launch_config}/tasks/main.yml (100%) rename tests/integration/targets/{ec2_asg_scheduled_action/defaults => autoscaling_launch_config/vars}/main.yml (100%) rename tests/integration/targets/{ec2_asg_lifecycle_hook => autoscaling_lifecycle_hook}/aliases (100%) rename tests/integration/targets/{ec2_asg_lifecycle_hook => autoscaling_lifecycle_hook}/inventory (100%) rename tests/integration/targets/{ec2_asg_lifecycle_hook => autoscaling_lifecycle_hook}/main.yml (100%) rename tests/integration/targets/{ec2_asg_lifecycle_hook => autoscaling_lifecycle_hook}/meta/main.yml (100%) rename tests/integration/targets/{ec2_asg_lifecycle_hook => autoscaling_lifecycle_hook}/roles/ec2_asg_lifecycle_hook/defaults/main.yml (100%) rename tests/integration/targets/{ec2_asg_lifecycle_hook => autoscaling_lifecycle_hook}/roles/ec2_asg_lifecycle_hook/tasks/create_update_delete.yml (100%) rename tests/integration/targets/{ec2_asg_lifecycle_hook => autoscaling_lifecycle_hook}/roles/ec2_asg_lifecycle_hook/tasks/env_cleanup.yml (100%) rename tests/integration/targets/{ec2_asg_lifecycle_hook => autoscaling_lifecycle_hook}/roles/ec2_asg_lifecycle_hook/tasks/env_setup.yml (100%) rename tests/integration/targets/{ec2_asg_lifecycle_hook => autoscaling_lifecycle_hook}/roles/ec2_asg_lifecycle_hook/tasks/main.yml (100%) rename tests/integration/targets/{ec2_asg_lifecycle_hook => autoscaling_lifecycle_hook}/runme.sh (100%) rename tests/integration/targets/{ec2_asg_scheduled_action => autoscaling_scheduled_action}/aliases (100%) rename tests/integration/targets/{ec2_lc/vars => autoscaling_scheduled_action/defaults}/main.yml (100%) rename tests/integration/targets/{ec2_asg_scheduled_action => autoscaling_scheduled_action}/meta/main.yml (100%) rename tests/integration/targets/{ec2_asg_scheduled_action => autoscaling_scheduled_action}/tasks/main.yml (100%) delete mode 100644 tests/integration/targets/ec2_asg_instance_refresh/aliases delete mode 100644 tests/integration/targets/ec2_lc/aliases diff --git a/meta/runtime.yml b/meta/runtime.yml index 81525370404..6545bbc057e 100644 --- a/meta/runtime.yml +++ b/meta/runtime.yml @@ -5,6 +5,16 @@ action_groups: - acm_certificate_info - api_gateway - api_gateway_domain + - autoscaling_group_info + - autoscaling_group + - autoscaling_instance_refresh_info + - autoscaling_instance_refresh + - autoscaling_launch_config_find + - autoscaling_launch_config_info + - autoscaling_launch_config + - autoscaling_lifecycle_hook + - autoscaling_policy + - autoscaling_scheduled_action - aws_acm - aws_acm_info - aws_api_gateway @@ -301,12 +311,42 @@ plugin_routing: aws_waf_web_acl: # Deprecation for this alias should not *start* prior to 2024-09-01 redirect: community.aws.waf_web_acl + ec2_asg: + # Deprecation for this alias should not *start* prior to 2024-09-01 + redirect: community.aws.autoscaling_group + ec2_asg_info: + # Deprecation for this alias should not *start* prior to 2024-09-01 + redirect: community.aws.autoscaling_group_info + ec2_asg_instance_refresh: + # Deprecation for this alias should not *start* prior to 2024-09-01 + redirect: community.aws.autoscaling_instance_refresh + ec2_asg_instance_refresh_info: + # Deprecation for this alias should not *start* prior to 2024-09-01 + redirect: community.aws.autoscaling_instance_refresh_info + ec2_asg_lifecycle_hook: + # Deprecation for this alias should not *start* prior to 2024-09-01 + redirect: community.aws.autoscaling_lifecycle_hook + ec2_asg_scheduled_action: + # Deprecation for this alias should not *start* prior to 2024-09-01 + redirect: community.aws.autoscaling_scheduled_action ec2_elb: redirect: community.aws.elb_instance ec2_instance: redirect: amazon.aws.ec2_instance ec2_instance_info: redirect: amazon.aws.ec2_instance_info + ec2_lc: + # Deprecation for this alias should not *start* prior to 2024-09-01 + redirect: community.aws.autoscaling_launch_config + ec2_lc_find: + # Deprecation for this alias should not *start* prior to 2024-09-01 + redirect: community.aws.autoscaling_launch_config_find + ec2_lc_info: + # Deprecation for this alias should not *start* prior to 2024-09-01 + redirect: community.aws.autoscaling_launch_config_info + ec2_scaling_policy: + # Deprecation for this alias should not *start* prior to 2024-09-01 + redirect: community.aws.autoscaling_policy ec2_vpc_endpoint: redirect: amazon.aws.ec2_vpc_endpoint ec2_vpc_endpoint_info: diff --git a/plugins/modules/ec2_asg.py b/plugins/modules/autoscaling_group.py similarity index 100% rename from plugins/modules/ec2_asg.py rename to plugins/modules/autoscaling_group.py diff --git a/plugins/modules/ec2_asg_info.py b/plugins/modules/autoscaling_group_info.py similarity index 100% rename from plugins/modules/ec2_asg_info.py rename to plugins/modules/autoscaling_group_info.py diff --git a/plugins/modules/ec2_asg_instance_refresh.py b/plugins/modules/autoscaling_instance_refresh.py similarity index 100% rename from plugins/modules/ec2_asg_instance_refresh.py rename to plugins/modules/autoscaling_instance_refresh.py diff --git a/plugins/modules/ec2_asg_instance_refresh_info.py b/plugins/modules/autoscaling_instance_refresh_info.py similarity index 100% rename from plugins/modules/ec2_asg_instance_refresh_info.py rename to plugins/modules/autoscaling_instance_refresh_info.py diff --git a/plugins/modules/ec2_lc.py b/plugins/modules/autoscaling_launch_config.py similarity index 100% rename from plugins/modules/ec2_lc.py rename to plugins/modules/autoscaling_launch_config.py diff --git a/plugins/modules/ec2_lc_find.py b/plugins/modules/autoscaling_launch_config_find.py similarity index 100% rename from plugins/modules/ec2_lc_find.py rename to plugins/modules/autoscaling_launch_config_find.py diff --git a/plugins/modules/ec2_lc_info.py b/plugins/modules/autoscaling_launch_config_info.py similarity index 100% rename from plugins/modules/ec2_lc_info.py rename to plugins/modules/autoscaling_launch_config_info.py diff --git a/plugins/modules/ec2_asg_lifecycle_hook.py b/plugins/modules/autoscaling_lifecycle_hook.py similarity index 100% rename from plugins/modules/ec2_asg_lifecycle_hook.py rename to plugins/modules/autoscaling_lifecycle_hook.py diff --git a/plugins/modules/ec2_scaling_policy.py b/plugins/modules/autoscaling_policy.py similarity index 100% rename from plugins/modules/ec2_scaling_policy.py rename to plugins/modules/autoscaling_policy.py diff --git a/plugins/modules/ec2_asg_scheduled_action.py b/plugins/modules/autoscaling_scheduled_action.py similarity index 100% rename from plugins/modules/ec2_asg_scheduled_action.py rename to plugins/modules/autoscaling_scheduled_action.py diff --git a/tests/integration/targets/ec2_asg/aliases b/tests/integration/targets/autoscaling_group/aliases similarity index 73% rename from tests/integration/targets/ec2_asg/aliases rename to tests/integration/targets/autoscaling_group/aliases index 89fb7f6259d..5619cbdc8d4 100644 --- a/tests/integration/targets/ec2_asg/aliases +++ b/tests/integration/targets/autoscaling_group/aliases @@ -4,4 +4,4 @@ slow cloud/aws -ec2_asg_info +autoscaling_group_info diff --git a/tests/integration/targets/ec2_asg/inventory b/tests/integration/targets/autoscaling_group/inventory similarity index 100% rename from tests/integration/targets/ec2_asg/inventory rename to tests/integration/targets/autoscaling_group/inventory diff --git a/tests/integration/targets/ec2_asg/main.yml b/tests/integration/targets/autoscaling_group/main.yml similarity index 100% rename from tests/integration/targets/ec2_asg/main.yml rename to tests/integration/targets/autoscaling_group/main.yml diff --git a/tests/integration/targets/ec2_asg/meta/main.yml b/tests/integration/targets/autoscaling_group/meta/main.yml similarity index 100% rename from tests/integration/targets/ec2_asg/meta/main.yml rename to tests/integration/targets/autoscaling_group/meta/main.yml diff --git a/tests/integration/targets/ec2_asg/roles/ec2_asg/defaults/main.yml b/tests/integration/targets/autoscaling_group/roles/ec2_asg/defaults/main.yml similarity index 100% rename from tests/integration/targets/ec2_asg/roles/ec2_asg/defaults/main.yml rename to tests/integration/targets/autoscaling_group/roles/ec2_asg/defaults/main.yml diff --git a/tests/integration/targets/ec2_asg/roles/ec2_asg/tasks/create_update_delete.yml b/tests/integration/targets/autoscaling_group/roles/ec2_asg/tasks/create_update_delete.yml similarity index 100% rename from tests/integration/targets/ec2_asg/roles/ec2_asg/tasks/create_update_delete.yml rename to tests/integration/targets/autoscaling_group/roles/ec2_asg/tasks/create_update_delete.yml diff --git a/tests/integration/targets/ec2_asg/roles/ec2_asg/tasks/env_cleanup.yml b/tests/integration/targets/autoscaling_group/roles/ec2_asg/tasks/env_cleanup.yml similarity index 100% rename from tests/integration/targets/ec2_asg/roles/ec2_asg/tasks/env_cleanup.yml rename to tests/integration/targets/autoscaling_group/roles/ec2_asg/tasks/env_cleanup.yml diff --git a/tests/integration/targets/ec2_asg/roles/ec2_asg/tasks/env_setup.yml b/tests/integration/targets/autoscaling_group/roles/ec2_asg/tasks/env_setup.yml similarity index 100% rename from tests/integration/targets/ec2_asg/roles/ec2_asg/tasks/env_setup.yml rename to tests/integration/targets/autoscaling_group/roles/ec2_asg/tasks/env_setup.yml diff --git a/tests/integration/targets/ec2_asg/roles/ec2_asg/tasks/instance_detach.yml b/tests/integration/targets/autoscaling_group/roles/ec2_asg/tasks/instance_detach.yml similarity index 100% rename from tests/integration/targets/ec2_asg/roles/ec2_asg/tasks/instance_detach.yml rename to tests/integration/targets/autoscaling_group/roles/ec2_asg/tasks/instance_detach.yml diff --git a/tests/integration/targets/ec2_asg/roles/ec2_asg/tasks/main.yml b/tests/integration/targets/autoscaling_group/roles/ec2_asg/tasks/main.yml similarity index 100% rename from tests/integration/targets/ec2_asg/roles/ec2_asg/tasks/main.yml rename to tests/integration/targets/autoscaling_group/roles/ec2_asg/tasks/main.yml diff --git a/tests/integration/targets/ec2_asg/roles/ec2_asg/tasks/tag_operations.yml b/tests/integration/targets/autoscaling_group/roles/ec2_asg/tasks/tag_operations.yml similarity index 100% rename from tests/integration/targets/ec2_asg/roles/ec2_asg/tasks/tag_operations.yml rename to tests/integration/targets/autoscaling_group/roles/ec2_asg/tasks/tag_operations.yml diff --git a/tests/integration/targets/ec2_asg/runme.sh b/tests/integration/targets/autoscaling_group/runme.sh similarity index 100% rename from tests/integration/targets/ec2_asg/runme.sh rename to tests/integration/targets/autoscaling_group/runme.sh diff --git a/tests/integration/targets/autoscaling_instance_refresh/aliases b/tests/integration/targets/autoscaling_instance_refresh/aliases new file mode 100644 index 00000000000..da172a8ebc1 --- /dev/null +++ b/tests/integration/targets/autoscaling_instance_refresh/aliases @@ -0,0 +1,2 @@ +cloud/aws +autoscaling_instance_refresh_info diff --git a/tests/integration/targets/ec2_asg_instance_refresh/defaults/main.yml b/tests/integration/targets/autoscaling_instance_refresh/defaults/main.yml similarity index 100% rename from tests/integration/targets/ec2_asg_instance_refresh/defaults/main.yml rename to tests/integration/targets/autoscaling_instance_refresh/defaults/main.yml diff --git a/tests/integration/targets/ec2_asg_instance_refresh/meta/main.yml b/tests/integration/targets/autoscaling_instance_refresh/meta/main.yml similarity index 100% rename from tests/integration/targets/ec2_asg_instance_refresh/meta/main.yml rename to tests/integration/targets/autoscaling_instance_refresh/meta/main.yml diff --git a/tests/integration/targets/ec2_asg_instance_refresh/tasks/main.yml b/tests/integration/targets/autoscaling_instance_refresh/tasks/main.yml similarity index 100% rename from tests/integration/targets/ec2_asg_instance_refresh/tasks/main.yml rename to tests/integration/targets/autoscaling_instance_refresh/tasks/main.yml diff --git a/tests/integration/targets/ec2_asg_instance_refresh/tasks/refresh_and_cancel_three_times.yml b/tests/integration/targets/autoscaling_instance_refresh/tasks/refresh_and_cancel_three_times.yml similarity index 100% rename from tests/integration/targets/ec2_asg_instance_refresh/tasks/refresh_and_cancel_three_times.yml rename to tests/integration/targets/autoscaling_instance_refresh/tasks/refresh_and_cancel_three_times.yml diff --git a/tests/integration/targets/ec2_asg_instance_refresh/vars/main.yml b/tests/integration/targets/autoscaling_instance_refresh/vars/main.yml similarity index 100% rename from tests/integration/targets/ec2_asg_instance_refresh/vars/main.yml rename to tests/integration/targets/autoscaling_instance_refresh/vars/main.yml diff --git a/tests/integration/targets/autoscaling_launch_config/aliases b/tests/integration/targets/autoscaling_launch_config/aliases new file mode 100644 index 00000000000..77fdadbaead --- /dev/null +++ b/tests/integration/targets/autoscaling_launch_config/aliases @@ -0,0 +1,4 @@ +cloud/aws + +autoscaling_launch_config_info +autoscaling_launch_config_find diff --git a/tests/integration/targets/ec2_lc/defaults/main.yml b/tests/integration/targets/autoscaling_launch_config/defaults/main.yml similarity index 100% rename from tests/integration/targets/ec2_lc/defaults/main.yml rename to tests/integration/targets/autoscaling_launch_config/defaults/main.yml diff --git a/tests/integration/targets/ec2_lc/meta/main.yml b/tests/integration/targets/autoscaling_launch_config/meta/main.yml similarity index 100% rename from tests/integration/targets/ec2_lc/meta/main.yml rename to tests/integration/targets/autoscaling_launch_config/meta/main.yml diff --git a/tests/integration/targets/ec2_lc/tasks/env_cleanup.yml b/tests/integration/targets/autoscaling_launch_config/tasks/env_cleanup.yml similarity index 100% rename from tests/integration/targets/ec2_lc/tasks/env_cleanup.yml rename to tests/integration/targets/autoscaling_launch_config/tasks/env_cleanup.yml diff --git a/tests/integration/targets/ec2_lc/tasks/env_setup.yml b/tests/integration/targets/autoscaling_launch_config/tasks/env_setup.yml similarity index 100% rename from tests/integration/targets/ec2_lc/tasks/env_setup.yml rename to tests/integration/targets/autoscaling_launch_config/tasks/env_setup.yml diff --git a/tests/integration/targets/ec2_lc/tasks/main.yml b/tests/integration/targets/autoscaling_launch_config/tasks/main.yml similarity index 100% rename from tests/integration/targets/ec2_lc/tasks/main.yml rename to tests/integration/targets/autoscaling_launch_config/tasks/main.yml diff --git a/tests/integration/targets/ec2_asg_scheduled_action/defaults/main.yml b/tests/integration/targets/autoscaling_launch_config/vars/main.yml similarity index 100% rename from tests/integration/targets/ec2_asg_scheduled_action/defaults/main.yml rename to tests/integration/targets/autoscaling_launch_config/vars/main.yml diff --git a/tests/integration/targets/ec2_asg_lifecycle_hook/aliases b/tests/integration/targets/autoscaling_lifecycle_hook/aliases similarity index 100% rename from tests/integration/targets/ec2_asg_lifecycle_hook/aliases rename to tests/integration/targets/autoscaling_lifecycle_hook/aliases diff --git a/tests/integration/targets/ec2_asg_lifecycle_hook/inventory b/tests/integration/targets/autoscaling_lifecycle_hook/inventory similarity index 100% rename from tests/integration/targets/ec2_asg_lifecycle_hook/inventory rename to tests/integration/targets/autoscaling_lifecycle_hook/inventory diff --git a/tests/integration/targets/ec2_asg_lifecycle_hook/main.yml b/tests/integration/targets/autoscaling_lifecycle_hook/main.yml similarity index 100% rename from tests/integration/targets/ec2_asg_lifecycle_hook/main.yml rename to tests/integration/targets/autoscaling_lifecycle_hook/main.yml diff --git a/tests/integration/targets/ec2_asg_lifecycle_hook/meta/main.yml b/tests/integration/targets/autoscaling_lifecycle_hook/meta/main.yml similarity index 100% rename from tests/integration/targets/ec2_asg_lifecycle_hook/meta/main.yml rename to tests/integration/targets/autoscaling_lifecycle_hook/meta/main.yml diff --git a/tests/integration/targets/ec2_asg_lifecycle_hook/roles/ec2_asg_lifecycle_hook/defaults/main.yml b/tests/integration/targets/autoscaling_lifecycle_hook/roles/ec2_asg_lifecycle_hook/defaults/main.yml similarity index 100% rename from tests/integration/targets/ec2_asg_lifecycle_hook/roles/ec2_asg_lifecycle_hook/defaults/main.yml rename to tests/integration/targets/autoscaling_lifecycle_hook/roles/ec2_asg_lifecycle_hook/defaults/main.yml diff --git a/tests/integration/targets/ec2_asg_lifecycle_hook/roles/ec2_asg_lifecycle_hook/tasks/create_update_delete.yml b/tests/integration/targets/autoscaling_lifecycle_hook/roles/ec2_asg_lifecycle_hook/tasks/create_update_delete.yml similarity index 100% rename from tests/integration/targets/ec2_asg_lifecycle_hook/roles/ec2_asg_lifecycle_hook/tasks/create_update_delete.yml rename to tests/integration/targets/autoscaling_lifecycle_hook/roles/ec2_asg_lifecycle_hook/tasks/create_update_delete.yml diff --git a/tests/integration/targets/ec2_asg_lifecycle_hook/roles/ec2_asg_lifecycle_hook/tasks/env_cleanup.yml b/tests/integration/targets/autoscaling_lifecycle_hook/roles/ec2_asg_lifecycle_hook/tasks/env_cleanup.yml similarity index 100% rename from tests/integration/targets/ec2_asg_lifecycle_hook/roles/ec2_asg_lifecycle_hook/tasks/env_cleanup.yml rename to tests/integration/targets/autoscaling_lifecycle_hook/roles/ec2_asg_lifecycle_hook/tasks/env_cleanup.yml diff --git a/tests/integration/targets/ec2_asg_lifecycle_hook/roles/ec2_asg_lifecycle_hook/tasks/env_setup.yml b/tests/integration/targets/autoscaling_lifecycle_hook/roles/ec2_asg_lifecycle_hook/tasks/env_setup.yml similarity index 100% rename from tests/integration/targets/ec2_asg_lifecycle_hook/roles/ec2_asg_lifecycle_hook/tasks/env_setup.yml rename to tests/integration/targets/autoscaling_lifecycle_hook/roles/ec2_asg_lifecycle_hook/tasks/env_setup.yml diff --git a/tests/integration/targets/ec2_asg_lifecycle_hook/roles/ec2_asg_lifecycle_hook/tasks/main.yml b/tests/integration/targets/autoscaling_lifecycle_hook/roles/ec2_asg_lifecycle_hook/tasks/main.yml similarity index 100% rename from tests/integration/targets/ec2_asg_lifecycle_hook/roles/ec2_asg_lifecycle_hook/tasks/main.yml rename to tests/integration/targets/autoscaling_lifecycle_hook/roles/ec2_asg_lifecycle_hook/tasks/main.yml diff --git a/tests/integration/targets/ec2_asg_lifecycle_hook/runme.sh b/tests/integration/targets/autoscaling_lifecycle_hook/runme.sh similarity index 100% rename from tests/integration/targets/ec2_asg_lifecycle_hook/runme.sh rename to tests/integration/targets/autoscaling_lifecycle_hook/runme.sh diff --git a/tests/integration/targets/ec2_asg_scheduled_action/aliases b/tests/integration/targets/autoscaling_scheduled_action/aliases similarity index 100% rename from tests/integration/targets/ec2_asg_scheduled_action/aliases rename to tests/integration/targets/autoscaling_scheduled_action/aliases diff --git a/tests/integration/targets/ec2_lc/vars/main.yml b/tests/integration/targets/autoscaling_scheduled_action/defaults/main.yml similarity index 100% rename from tests/integration/targets/ec2_lc/vars/main.yml rename to tests/integration/targets/autoscaling_scheduled_action/defaults/main.yml diff --git a/tests/integration/targets/ec2_asg_scheduled_action/meta/main.yml b/tests/integration/targets/autoscaling_scheduled_action/meta/main.yml similarity index 100% rename from tests/integration/targets/ec2_asg_scheduled_action/meta/main.yml rename to tests/integration/targets/autoscaling_scheduled_action/meta/main.yml diff --git a/tests/integration/targets/ec2_asg_scheduled_action/tasks/main.yml b/tests/integration/targets/autoscaling_scheduled_action/tasks/main.yml similarity index 100% rename from tests/integration/targets/ec2_asg_scheduled_action/tasks/main.yml rename to tests/integration/targets/autoscaling_scheduled_action/tasks/main.yml diff --git a/tests/integration/targets/ec2_asg_instance_refresh/aliases b/tests/integration/targets/ec2_asg_instance_refresh/aliases deleted file mode 100644 index 29bc7f5288f..00000000000 --- a/tests/integration/targets/ec2_asg_instance_refresh/aliases +++ /dev/null @@ -1,2 +0,0 @@ -cloud/aws -ec2_asg_instance_refresh_info diff --git a/tests/integration/targets/ec2_lc/aliases b/tests/integration/targets/ec2_lc/aliases deleted file mode 100644 index df93245119a..00000000000 --- a/tests/integration/targets/ec2_lc/aliases +++ /dev/null @@ -1,4 +0,0 @@ -cloud/aws - -ec2_lc_info -ec2_lc_find From bd6c406615a4f53ac250f9e9891a70404fa95802 Mon Sep 17 00:00:00 2001 From: Mark Chappell Date: Fri, 1 Jul 2022 16:55:59 +0200 Subject: [PATCH 2/4] docs --- README.md | 20 ++++---- ...ity.aws.autoscaling_group_info_module.rst} | 27 +++++----- ...ommunity.aws.autoscaling_group_module.rst} | 27 +++++----- ...oscaling_instance_refresh_info_module.rst} | 34 ++++++------- ...s.autoscaling_instance_refresh_module.rst} | 17 ++++--- ...autoscaling_launch_config_find_module.rst} | 13 ++--- ...autoscaling_launch_config_info_module.rst} | 45 ++++++++-------- ....aws.autoscaling_launch_config_module.rst} | 28 +++++----- ...aws.autoscaling_lifecycle_hook_module.rst} | 29 ++++++----- ...mmunity.aws.autoscaling_policy_module.rst} | 43 ++++++++-------- ...s.autoscaling_scheduled_action_module.rst} | 17 ++++--- ...mmunity.aws.ec2_launch_template_module.rst | 2 +- plugins/modules/autoscaling_group.py | 30 ++++++----- plugins/modules/autoscaling_group_info.py | 32 ++++++------ .../modules/autoscaling_instance_refresh.py | 20 ++++---- .../autoscaling_instance_refresh_info.py | 38 +++++++------- plugins/modules/autoscaling_launch_config.py | 32 ++++++------ .../modules/autoscaling_launch_config_find.py | 17 ++++--- .../modules/autoscaling_launch_config_info.py | 51 ++++++++++--------- plugins/modules/autoscaling_lifecycle_hook.py | 33 ++++++------ plugins/modules/autoscaling_policy.py | 47 ++++++++--------- .../modules/autoscaling_scheduled_action.py | 13 +++-- plugins/modules/ec2_launch_template.py | 2 +- test-requirements.txt | 2 +- 24 files changed, 318 insertions(+), 301 deletions(-) rename docs/{community.aws.ec2_asg_info_module.rst => community.aws.autoscaling_group_info_module.rst} (97%) rename docs/{community.aws.ec2_asg_module.rst => community.aws.autoscaling_group_module.rst} (99%) rename docs/{community.aws.ec2_asg_instance_refresh_info_module.rst => community.aws.autoscaling_instance_refresh_info_module.rst} (93%) rename docs/{community.aws.ec2_asg_instance_refresh_module.rst => community.aws.autoscaling_instance_refresh_module.rst} (97%) rename docs/{community.aws.ec2_lc_find_module.rst => community.aws.autoscaling_launch_config_find_module.rst} (98%) rename docs/{community.aws.ec2_lc_info_module.rst => community.aws.autoscaling_launch_config_info_module.rst} (96%) rename docs/{community.aws.ec2_lc_module.rst => community.aws.autoscaling_launch_config_module.rst} (98%) rename docs/{community.aws.ec2_asg_lifecycle_hook_module.rst => community.aws.autoscaling_lifecycle_hook_module.rst} (96%) rename docs/{community.aws.ec2_scaling_policy_module.rst => community.aws.autoscaling_policy_module.rst} (97%) rename docs/{community.aws.ec2_asg_scheduled_action_module.rst => community.aws.autoscaling_scheduled_action_module.rst} (98%) diff --git a/README.md b/README.md index d9aa702a0d7..7a08d5319a9 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,16 @@ Name | Description [community.aws.acm_certificate_info](https://github.com/ansible-collections/community.aws/blob/main/docs/community.aws.acm_certificate_info_module.rst)|Retrieve certificate information from AWS Certificate Manager service [community.aws.api_gateway](https://github.com/ansible-collections/community.aws/blob/main/docs/community.aws.api_gateway_module.rst)|Manage AWS API Gateway APIs [community.aws.api_gateway_domain](https://github.com/ansible-collections/community.aws/blob/main/docs/community.aws.api_gateway_domain_module.rst)|Manage AWS API Gateway custom domains +[community.aws.autoscaling_group](https://github.com/ansible-collections/community.aws/blob/main/docs/community.aws.autoscaling_group_module.rst)|Create or delete AWS AutoScaling Groups (ASGs) +[community.aws.autoscaling_group_info](https://github.com/ansible-collections/community.aws/blob/main/docs/community.aws.autoscaling_group_info_module.rst)|Gather information about EC2 Auto Scaling Groups (ASGs) in AWS +[community.aws.autoscaling_instance_refresh](https://github.com/ansible-collections/community.aws/blob/main/docs/community.aws.autoscaling_instance_refresh_module.rst)|Start or cancel an EC2 Auto Scaling Group (ASG) instance refresh in AWS +[community.aws.autoscaling_instance_refresh_info](https://github.com/ansible-collections/community.aws/blob/main/docs/community.aws.autoscaling_instance_refresh_info_module.rst)|Gather information about EC2 Auto Scaling Group (ASG) Instance Refreshes in AWS +[community.aws.autoscaling_launch_config](https://github.com/ansible-collections/community.aws/blob/main/docs/community.aws.autoscaling_launch_config_module.rst)|Create or delete AWS Autoscaling Launch Configurations +[community.aws.autoscaling_launch_config_find](https://github.com/ansible-collections/community.aws/blob/main/docs/community.aws.autoscaling_launch_config_find_module.rst)|Find AWS Autoscaling Launch Configurations +[community.aws.autoscaling_launch_config_info](https://github.com/ansible-collections/community.aws/blob/main/docs/community.aws.autoscaling_launch_config_info_module.rst)|Gather information about AWS Autoscaling Launch Configurations +[community.aws.autoscaling_lifecycle_hook](https://github.com/ansible-collections/community.aws/blob/main/docs/community.aws.autoscaling_lifecycle_hook_module.rst)|Create, delete or update AWS ASG Lifecycle Hooks +[community.aws.autoscaling_policy](https://github.com/ansible-collections/community.aws/blob/main/docs/community.aws.autoscaling_policy_module.rst)|Create or delete AWS scaling policies for Autoscaling groups +[community.aws.autoscaling_scheduled_action](https://github.com/ansible-collections/community.aws/blob/main/docs/community.aws.autoscaling_scheduled_action_module.rst)|Create, modify and delete ASG scheduled scaling actions [community.aws.aws_application_scaling_policy](https://github.com/ansible-collections/community.aws/blob/main/docs/community.aws.aws_application_scaling_policy_module.rst)|Manage Application Auto Scaling Scaling Policies [community.aws.aws_codebuild](https://github.com/ansible-collections/community.aws/blob/main/docs/community.aws.aws_codebuild_module.rst)|Create or delete an AWS CodeBuild project [community.aws.aws_codecommit](https://github.com/ansible-collections/community.aws/blob/main/docs/community.aws.aws_codecommit_module.rst)|Manage repositories in AWS CodeCommit @@ -82,24 +92,14 @@ Name | Description [community.aws.dynamodb_table](https://github.com/ansible-collections/community.aws/blob/main/docs/community.aws.dynamodb_table_module.rst)|Create, update or delete AWS Dynamo DB tables [community.aws.dynamodb_ttl](https://github.com/ansible-collections/community.aws/blob/main/docs/community.aws.dynamodb_ttl_module.rst)|Set TTL for a given DynamoDB table [community.aws.ec2_ami_copy](https://github.com/ansible-collections/community.aws/blob/main/docs/community.aws.ec2_ami_copy_module.rst)|copies AMI between AWS regions, return new image id -[community.aws.ec2_asg](https://github.com/ansible-collections/community.aws/blob/main/docs/community.aws.ec2_asg_module.rst)|Create or delete AWS AutoScaling Groups (ASGs) -[community.aws.ec2_asg_info](https://github.com/ansible-collections/community.aws/blob/main/docs/community.aws.ec2_asg_info_module.rst)|Gather information about ec2 Auto Scaling Groups (ASGs) in AWS -[community.aws.ec2_asg_instance_refresh](https://github.com/ansible-collections/community.aws/blob/main/docs/community.aws.ec2_asg_instance_refresh_module.rst)|Start or cancel an EC2 Auto Scaling Group (ASG) instance refresh in AWS -[community.aws.ec2_asg_instance_refresh_info](https://github.com/ansible-collections/community.aws/blob/main/docs/community.aws.ec2_asg_instance_refresh_info_module.rst)|Gather information about ec2 Auto Scaling Group (ASG) Instance Refreshes in AWS -[community.aws.ec2_asg_lifecycle_hook](https://github.com/ansible-collections/community.aws/blob/main/docs/community.aws.ec2_asg_lifecycle_hook_module.rst)|Create, delete or update AWS ASG Lifecycle Hooks. -[community.aws.ec2_asg_scheduled_action](https://github.com/ansible-collections/community.aws/blob/main/docs/community.aws.ec2_asg_scheduled_action_module.rst)|Create, modify and delete ASG scheduled scaling actions. [community.aws.ec2_customer_gateway](https://github.com/ansible-collections/community.aws/blob/main/docs/community.aws.ec2_customer_gateway_module.rst)|Manage an AWS customer gateway [community.aws.ec2_customer_gateway_info](https://github.com/ansible-collections/community.aws/blob/main/docs/community.aws.ec2_customer_gateway_info_module.rst)|Gather information about customer gateways in AWS [community.aws.ec2_eip](https://github.com/ansible-collections/community.aws/blob/main/docs/community.aws.ec2_eip_module.rst)|manages EC2 elastic IP (EIP) addresses. [community.aws.ec2_eip_info](https://github.com/ansible-collections/community.aws/blob/main/docs/community.aws.ec2_eip_info_module.rst)|List EC2 EIP details [community.aws.ec2_launch_template](https://github.com/ansible-collections/community.aws/blob/main/docs/community.aws.ec2_launch_template_module.rst)|Manage EC2 launch templates -[community.aws.ec2_lc](https://github.com/ansible-collections/community.aws/blob/main/docs/community.aws.ec2_lc_module.rst)|Create or delete AWS Autoscaling Launch Configurations -[community.aws.ec2_lc_find](https://github.com/ansible-collections/community.aws/blob/main/docs/community.aws.ec2_lc_find_module.rst)|Find AWS Autoscaling Launch Configurations -[community.aws.ec2_lc_info](https://github.com/ansible-collections/community.aws/blob/main/docs/community.aws.ec2_lc_info_module.rst)|Gather information about AWS Autoscaling Launch Configurations. [community.aws.ec2_metric_alarm](https://github.com/ansible-collections/community.aws/blob/main/docs/community.aws.ec2_metric_alarm_module.rst)|Create/update or delete AWS Cloudwatch 'metric alarms' [community.aws.ec2_placement_group](https://github.com/ansible-collections/community.aws/blob/main/docs/community.aws.ec2_placement_group_module.rst)|Create or delete an EC2 Placement Group [community.aws.ec2_placement_group_info](https://github.com/ansible-collections/community.aws/blob/main/docs/community.aws.ec2_placement_group_info_module.rst)|List EC2 Placement Group(s) details -[community.aws.ec2_scaling_policy](https://github.com/ansible-collections/community.aws/blob/main/docs/community.aws.ec2_scaling_policy_module.rst)|Create or delete AWS scaling policies for Autoscaling groups [community.aws.ec2_snapshot_copy](https://github.com/ansible-collections/community.aws/blob/main/docs/community.aws.ec2_snapshot_copy_module.rst)|Copies an EC2 snapshot and returns the new Snapshot ID [community.aws.ec2_transit_gateway](https://github.com/ansible-collections/community.aws/blob/main/docs/community.aws.ec2_transit_gateway_module.rst)|Create and delete AWS Transit Gateways [community.aws.ec2_transit_gateway_info](https://github.com/ansible-collections/community.aws/blob/main/docs/community.aws.ec2_transit_gateway_info_module.rst)|Gather information about ec2 transit gateways in AWS diff --git a/docs/community.aws.ec2_asg_info_module.rst b/docs/community.aws.autoscaling_group_info_module.rst similarity index 97% rename from docs/community.aws.ec2_asg_info_module.rst rename to docs/community.aws.autoscaling_group_info_module.rst index 008a40eb84e..0238c456b15 100644 --- a/docs/community.aws.ec2_asg_info_module.rst +++ b/docs/community.aws.autoscaling_group_info_module.rst @@ -1,11 +1,11 @@ -.. _community.aws.ec2_asg_info_module: +.. _community.aws.autoscaling_group_info_module: -************************** -community.aws.ec2_asg_info -************************** +************************************ +community.aws.autoscaling_group_info +************************************ -**Gather information about ec2 Auto Scaling Groups (ASGs) in AWS** +**Gather information about EC2 Auto Scaling Groups (ASGs) in AWS** Version added: 1.0.0 @@ -17,7 +17,8 @@ Version added: 1.0.0 Synopsis -------- -- Gather information about ec2 Auto Scaling Groups (ASGs) in AWS +- Gather information about EC2 Auto Scaling Groups (ASGs) in AWS. +- Prior to release 5.0.0 this module was called ``community.aws.ec2_asg_info``. The usage did not change. @@ -264,36 +265,36 @@ Examples # Note: These examples do not set authentication details, see the AWS Guide for details. - name: Find all groups - community.aws.ec2_asg_info: + community.aws.autoscaling_group_info: register: asgs - name: Find a group with matching name/prefix - community.aws.ec2_asg_info: + community.aws.autoscaling_group_info: name: public-webserver-asg register: asgs - name: Find a group with matching tags - community.aws.ec2_asg_info: + community.aws.autoscaling_group_info: tags: project: webapp env: production register: asgs - name: Find a group with matching name/prefix and tags - community.aws.ec2_asg_info: + community.aws.autoscaling_group_info: name: myproject tags: env: production register: asgs - name: Fail if no groups are found - community.aws.ec2_asg_info: + community.aws.autoscaling_group_info: name: public-webserver-asg register: asgs failed_when: "{{ asgs.results | length == 0 }}" - name: Fail if more than 1 group is found - community.aws.ec2_asg_info: + community.aws.autoscaling_group_info: name: public-webserver-asg register: asgs failed_when: "{{ asgs.results | length > 1 }}" @@ -476,7 +477,7 @@ Common return values are documented `here success -
Name of launch configuration associated with the ASG. Same as launch_configuration_name, provided for compatibility with ec2_asg module.
+
Name of launch configuration associated with the ASG. Same as launch_configuration_name, provided for compatibility with community.aws.autoscaling_group module.

Sample:
public-webapp-production-1
diff --git a/docs/community.aws.ec2_asg_module.rst b/docs/community.aws.autoscaling_group_module.rst similarity index 99% rename from docs/community.aws.ec2_asg_module.rst rename to docs/community.aws.autoscaling_group_module.rst index 8017c390879..a78ba0925e7 100644 --- a/docs/community.aws.ec2_asg_module.rst +++ b/docs/community.aws.autoscaling_group_module.rst @@ -1,9 +1,9 @@ -.. _community.aws.ec2_asg_module: +.. _community.aws.autoscaling_group_module: -********************* -community.aws.ec2_asg -********************* +******************************* +community.aws.autoscaling_group +******************************* **Create or delete AWS AutoScaling Groups (ASGs)** @@ -18,7 +18,8 @@ Version added: 1.0.0 Synopsis -------- - Can create or delete AWS AutoScaling Groups. -- Can be used with the :ref:`community.aws.ec2_lc ` module to manage Launch Configurations. +- Can be used with the :ref:`community.aws.autoscaling_launch_config ` module to manage Launch Configurations. +- Prior to release 5.0.0 this module was called ``community.aws.ec2_asg``. The usage did not change. @@ -278,7 +279,7 @@ Parameters -
Name of the Launch configuration to use for the group. See the community.aws.ec2_lc) module for managing these.
+
Name of the Launch configuration to use for the group. See the community.aws.autoscaling_launch_config) module for managing these.
If unspecified then the current group value will be used. One of launch_config_name or launch_template must be provided.
@@ -1040,7 +1041,7 @@ Examples # Basic configuration with Launch Configuration - - community.aws.ec2_asg: + - community.aws.autoscaling_group: name: special load_balancers: [ 'lb1', 'lb2' ] availability_zones: [ 'eu-west-1a', 'eu-west-1b' ] @@ -1066,7 +1067,7 @@ Examples # will have the current launch configuration. - name: create launch config - community.aws.ec2_lc: + community.aws.autoscaling_launch_config: name: my_new_lc image_id: ami-lkajsf key_name: mykey @@ -1075,7 +1076,7 @@ Examples instance_type: m1.small assign_public_ip: yes - - community.aws.ec2_asg: + - community.aws.autoscaling_group: name: myasg launch_config_name: my_new_lc health_check_period: 60 @@ -1089,7 +1090,7 @@ Examples # To only replace a couple of instances instead of all of them, supply a list # to "replace_instances": - - community.aws.ec2_asg: + - community.aws.autoscaling_group: name: myasg launch_config_name: my_new_lc health_check_period: 60 @@ -1104,7 +1105,7 @@ Examples # Basic Configuration with Launch Template - - community.aws.ec2_asg: + - community.aws.autoscaling_group: name: special load_balancers: [ 'lb1', 'lb2' ] availability_zones: [ 'eu-west-1a', 'eu-west-1b' ] @@ -1122,7 +1123,7 @@ Examples # Basic Configuration with Launch Template using mixed instance policy - - community.aws.ec2_asg: + - community.aws.autoscaling_group: name: special load_balancers: [ 'lb1', 'lb2' ] availability_zones: [ 'eu-west-1a', 'eu-west-1b' ] @@ -1375,7 +1376,7 @@ Common return values are documented `here success -
Name of launch configuration associated with the ASG. Same as launch_configuration_name, provided for compatibility with ec2_asg module.
+
Name of launch configuration associated with the ASG. Same as launch_configuration_name, provided for compatibility with community.aws.autoscaling_group module.

Sample:
public-webapp-production-1
diff --git a/docs/community.aws.ec2_asg_instance_refresh_info_module.rst b/docs/community.aws.autoscaling_instance_refresh_info_module.rst similarity index 93% rename from docs/community.aws.ec2_asg_instance_refresh_info_module.rst rename to docs/community.aws.autoscaling_instance_refresh_info_module.rst index d36b1f7c72c..316d1fd560b 100644 --- a/docs/community.aws.ec2_asg_instance_refresh_info_module.rst +++ b/docs/community.aws.autoscaling_instance_refresh_info_module.rst @@ -1,11 +1,11 @@ -.. _community.aws.ec2_asg_instance_refresh_info_module: +.. _community.aws.autoscaling_instance_refresh_info_module: -******************************************* -community.aws.ec2_asg_instance_refresh_info -******************************************* +*********************************************** +community.aws.autoscaling_instance_refresh_info +*********************************************** -**Gather information about ec2 Auto Scaling Group (ASG) Instance Refreshes in AWS** +**Gather information about EC2 Auto Scaling Group (ASG) Instance Refreshes in AWS** Version added: 3.2.0 @@ -19,6 +19,7 @@ Synopsis -------- - Describes one or more instance refreshes. - You can determine the status of a request by looking at the *status* parameter. +- Prior to release 5.0.0 this module was called ``community.aws.ec2_asg_instance_refresh_info``. The usage did not change. @@ -297,23 +298,23 @@ Examples # Note: These examples do not set authentication details, see the AWS Guide for details. - name: Find an refresh by ASG name - community.aws.ec2_asg_instance_refresh_info: + community.aws.autoscaling_instance_refresh_info: name: somename-asg - name: Find an refresh by ASG name and one or more refresh-IDs - community.aws.ec2_asg_instance_refresh_info: + community.aws.autoscaling_instance_refresh_info: name: somename-asg ids: ['some-id-123'] register: asgs - name: Find an refresh by ASG name and set max_records - community.aws.ec2_asg_instance_refresh_info: + community.aws.autoscaling_instance_refresh_info: name: somename-asg max_records: 4 register: asgs - name: Find an refresh by ASG name and NextToken, if received from a previous call - community.aws.ec2_asg_instance_refresh_info: + community.aws.autoscaling_instance_refresh_info: name: somename-asg next_token: 'some-token-123' register: asgs @@ -447,15 +448,12 @@ Common return values are documented `here
The current state of the group when DeleteAutoScalingGroup is in progress.
The following are the possible statuses
-
Pending -- The request was created, but the operation has not started.
-
InProgress -- The operation is in progress.
-
Successful -- The operation completed successfully.
-
Failed -- The operation failed to complete. You can troubleshoot using the status reason and the scaling activities.
-
Cancelling --
-
An ongoing operation is being cancelled.
-
Cancellation does not roll back any replacements that have already been completed,
-
but it prevents new replacements from being started.
-
Cancelled -- The operation is cancelled.
+
Pending: The request was created, but the operation has not started.
+
InProgress: The operation is in progress.
+
Successful: The operation completed successfully.
+
Failed: The operation failed to complete. You can troubleshoot using the status reason and the scaling activities.
+
Cancelling: An ongoing operation is being cancelled. Cancellation does not roll back any replacements that have already been completed, but it prevents new replacements from being started.
+
Cancelled: The operation is cancelled.

Sample:
Pending
diff --git a/docs/community.aws.ec2_asg_instance_refresh_module.rst b/docs/community.aws.autoscaling_instance_refresh_module.rst similarity index 97% rename from docs/community.aws.ec2_asg_instance_refresh_module.rst rename to docs/community.aws.autoscaling_instance_refresh_module.rst index 3f60722709e..4e903b8eba2 100644 --- a/docs/community.aws.ec2_asg_instance_refresh_module.rst +++ b/docs/community.aws.autoscaling_instance_refresh_module.rst @@ -1,9 +1,9 @@ -.. _community.aws.ec2_asg_instance_refresh_module: +.. _community.aws.autoscaling_instance_refresh_module: -************************************** -community.aws.ec2_asg_instance_refresh -************************************** +****************************************** +community.aws.autoscaling_instance_refresh +****************************************** **Start or cancel an EC2 Auto Scaling Group (ASG) instance refresh in AWS** @@ -18,7 +18,8 @@ Version added: 3.2.0 Synopsis -------- - Start or cancel an EC2 Auto Scaling Group instance refresh in AWS. -- Can be used with :ref:`community.aws.ec2_asg_instance_refresh_info ` to track the subsequent progress. +- Can be used with :ref:`community.aws.autoscaling_instance_refresh_info ` to track the subsequent progress. +- Prior to release 5.0.0 this module was called ``community.aws.ec2_asg_instance_refresh``. The usage did not change. @@ -345,17 +346,17 @@ Examples # Note: These examples do not set authentication details, see the AWS Guide for details. - name: Start a refresh - community.aws.ec2_asg_instance_refresh: + community.aws.autoscaling_instance_refresh: name: some-asg state: started - name: Cancel a refresh - community.aws.ec2_asg_instance_refresh: + community.aws.autoscaling_instance_refresh: name: some-asg state: cancelled - name: Start a refresh and pass preferences - community.aws.ec2_asg_instance_refresh: + community.aws.autoscaling_instance_refresh: name: some-asg state: started preferences: diff --git a/docs/community.aws.ec2_lc_find_module.rst b/docs/community.aws.autoscaling_launch_config_find_module.rst similarity index 98% rename from docs/community.aws.ec2_lc_find_module.rst rename to docs/community.aws.autoscaling_launch_config_find_module.rst index 2c78807c940..f64787ab382 100644 --- a/docs/community.aws.ec2_lc_find_module.rst +++ b/docs/community.aws.autoscaling_launch_config_find_module.rst @@ -1,9 +1,9 @@ -.. _community.aws.ec2_lc_find_module: +.. _community.aws.autoscaling_launch_config_find_module: -************************* -community.aws.ec2_lc_find -************************* +******************************************** +community.aws.autoscaling_launch_config_find +******************************************** **Find AWS Autoscaling Launch Configurations** @@ -19,7 +19,8 @@ Synopsis -------- - Returns list of matching Launch Configurations for a given name, along with other useful information. - Results can be sorted and sliced. -- Based on the work by Tom Bamford https://github.com/tombamford +- Based on the work by Tom Bamford https://github.com/tombamford. +- Prior to release 5.0.0 this module was called ``community.aws.ec2_lc_find``. The usage did not change. @@ -287,7 +288,7 @@ Examples # Note: These examples do not set authentication details, see the AWS Guide for details. - name: Search for the Launch Configurations that start with "app" - community.aws.ec2_lc_find: + community.aws.autoscaling_launch_config_find: name_regex: app.* sort_order: descending limit: 2 diff --git a/docs/community.aws.ec2_lc_info_module.rst b/docs/community.aws.autoscaling_launch_config_info_module.rst similarity index 96% rename from docs/community.aws.ec2_lc_info_module.rst rename to docs/community.aws.autoscaling_launch_config_info_module.rst index 507e814e85f..ae35dcdc620 100644 --- a/docs/community.aws.ec2_lc_info_module.rst +++ b/docs/community.aws.autoscaling_launch_config_info_module.rst @@ -1,11 +1,11 @@ -.. _community.aws.ec2_lc_info_module: +.. _community.aws.autoscaling_launch_config_info_module: -************************* -community.aws.ec2_lc_info -************************* +******************************************** +community.aws.autoscaling_launch_config_info +******************************************** -**Gather information about AWS Autoscaling Launch Configurations.** +**Gather information about AWS Autoscaling Launch Configurations** Version added: 1.0.0 @@ -18,6 +18,7 @@ Version added: 1.0.0 Synopsis -------- - Gather information about AWS Autoscaling Launch Configurations. +- Prior to release 5.0.0 this module was called ``community.aws.ec2_lc_info``. The usage did not change. @@ -326,14 +327,14 @@ Examples # Note: These examples do not set authentication details, see the AWS Guide for details. - name: Gather information about all launch configurations - community.aws.ec2_lc_info: + community.aws.autoscaling_launch_config_info: - name: Gather information about launch configuration with name "example" - community.aws.ec2_lc_info: + community.aws.autoscaling_launch_config_info: name: example - name: Gather information sorted by created_time from most recent to least recent - community.aws.ec2_lc_info: + community.aws.autoscaling_launch_config_info: sort: created_time sort_order: descending @@ -362,7 +363,7 @@ Common return values are documented `here always -
Block device mapping for the instances of launch configuration
+
Block device mapping for the instances of launch configuration.

Sample:
[{ 'device_name': '/dev/xvda':, 'ebs': { 'delete_on_termination': true, 'volume_size': 8, 'volume_type': 'gp2' }]
@@ -379,7 +380,7 @@ Common return values are documented `here always -
IDs of one or more security groups for the VPC specified in classic_link_vpc_id
+
IDs of one or more security groups for the VPC specified in classic_link_vpc_id.

@@ -394,7 +395,7 @@ Common return values are documented `here always -
The creation date and time for the launch configuration
+
The creation date and time for the launch configuration.

Sample:
2016-05-27T13:47:44.216000+00:00
@@ -411,7 +412,7 @@ Common return values are documented `here always -
EBS I/O optimized (true ) or not (false )
+
EBS I/O optimized true or not false.

Sample:
true,
@@ -428,7 +429,7 @@ Common return values are documented `here always -
ID of the Amazon Machine Image (AMI)
+
ID of the Amazon Machine Image (AMI).

Sample:
ami-12345678
@@ -445,7 +446,7 @@ Common return values are documented `here always -
Launched with detailed monitoring or not
+
Launched with detailed monitoring or not.

Sample:
{ 'enabled': true }
@@ -462,7 +463,7 @@ Common return values are documented `here always -
Instance type
+
Instance type.

Sample:
t2.micro
@@ -479,7 +480,7 @@ Common return values are documented `here always -
ID of the kernel associated with the AMI
+
ID of the kernel associated with the AMI.

@@ -494,7 +495,7 @@ Common return values are documented `here always -
Name of the key pair
+
Name of the key pair.

Sample:
user_app
@@ -511,7 +512,7 @@ Common return values are documented `here always -
Amazon Resource Name (ARN) of the launch configuration
+
Amazon Resource Name (ARN) of the launch configuration.

Sample:
arn:aws:autoscaling:us-east-1:666612345678:launchConfiguration:ba785e3a-dd42-6f02-4585-ea1a2b458b3d:launchConfigurationName/lc-app
@@ -528,7 +529,7 @@ Common return values are documented `here always -
Name of the launch configuration
+
Name of the launch configuration.

Sample:
lc-app
@@ -545,7 +546,7 @@ Common return values are documented `here always -
ID of the RAM disk associated with the AMI
+
ID of the RAM disk associated with the AMI.

@@ -560,7 +561,7 @@ Common return values are documented `here always -
Security groups to associated
+
Security groups to associated.

Sample:
[ 'web' ]
@@ -577,7 +578,7 @@ Common return values are documented `here always -
User data available
+
User data available.

diff --git a/docs/community.aws.ec2_lc_module.rst b/docs/community.aws.autoscaling_launch_config_module.rst similarity index 98% rename from docs/community.aws.ec2_lc_module.rst rename to docs/community.aws.autoscaling_launch_config_module.rst index 9608eb2a487..9d5c5138623 100644 --- a/docs/community.aws.ec2_lc_module.rst +++ b/docs/community.aws.autoscaling_launch_config_module.rst @@ -1,9 +1,9 @@ -.. _community.aws.ec2_lc_module: +.. _community.aws.autoscaling_launch_config_module: -******************** -community.aws.ec2_lc -******************** +*************************************** +community.aws.autoscaling_launch_config +*************************************** **Create or delete AWS Autoscaling Launch Configurations** @@ -18,7 +18,8 @@ Version added: 1.0.0 Synopsis -------- - Can create or delete AWS Autoscaling Configurations. -- Works with the ec2_asg module to manage Autoscaling Groups. +- Works with the :ref:`community.aws.autoscaling_group ` module to manage Autoscaling Groups. +- Prior to release 5.0.0 this module was called ``community.aws.ec2_lc``. The usage did not change. @@ -418,7 +419,8 @@ Parameters -
A list of security groups to apply to the instances. Since version 2.4 you can specify either security group names or IDs or a mix. Previous to 2.4, for VPC instances, specify security group IDs and for EC2-Classic, specify either security group names or IDs.
+
A list of security groups to apply to the instances.
+
You can specify either security group names or IDs or a mix.
@@ -536,7 +538,7 @@ Parameters
A list dictionaries defining the volumes to create.
-
For any volume, a volume size less than 1 will be interpreted as a request not to create the volume.
+
For any volume, a volume size less than 1 will be interpreted as a request not to create the volume.
@@ -757,7 +759,7 @@ Examples .. code-block:: yaml - name: create a launch configuration with an encrypted volume - community.aws.ec2_lc: + community.aws.autoscaling_launch_config: name: special image_id: ami-XXX key_name: default @@ -774,7 +776,7 @@ Examples ephemeral: ephemeral0 - name: create a launch configuration using a running instance id as a basis - community.aws.ec2_lc: + community.aws.autoscaling_launch_config: name: special instance_id: i-00a48b207ec59e948 key_name: default @@ -787,7 +789,7 @@ Examples delete_on_termination: true - name: create a launch configuration to omit the /dev/sdf EBS device that is included in the AMI image - community.aws.ec2_lc: + community.aws.autoscaling_launch_config: name: special image_id: ami-XXX key_name: default @@ -811,7 +813,7 @@ Examples encrypted: no - name: Create launch configuration - community.aws.ec2_lc: + community.aws.autoscaling_launch_config: name: lc1 image_id: ami-xxxx assign_public_ip: yes @@ -1157,7 +1159,7 @@ Common return values are documented `here when state=present -
Indicates whether the instance is optimized for EBS I/O (true) or not (false).
+
Indicates whether the instance is optimized for EBS I/O true or not false.

@@ -1191,7 +1193,7 @@ Common return values are documented `here when state=present -
Indicates whether instances in this group are launched with detailed (true) or basic (false) monitoring.
+
Indicates whether instances in this group are launched with detailed true or basic false monitoring.

Sample:
True
diff --git a/docs/community.aws.ec2_asg_lifecycle_hook_module.rst b/docs/community.aws.autoscaling_lifecycle_hook_module.rst similarity index 96% rename from docs/community.aws.ec2_asg_lifecycle_hook_module.rst rename to docs/community.aws.autoscaling_lifecycle_hook_module.rst index 945194ce5df..fa321679b68 100644 --- a/docs/community.aws.ec2_asg_lifecycle_hook_module.rst +++ b/docs/community.aws.autoscaling_lifecycle_hook_module.rst @@ -1,11 +1,11 @@ -.. _community.aws.ec2_asg_lifecycle_hook_module: +.. _community.aws.autoscaling_lifecycle_hook_module: -************************************ -community.aws.ec2_asg_lifecycle_hook -************************************ +**************************************** +community.aws.autoscaling_lifecycle_hook +**************************************** -**Create, delete or update AWS ASG Lifecycle Hooks.** +**Create, delete or update AWS ASG Lifecycle Hooks** Version added: 1.0.0 @@ -20,6 +20,7 @@ Synopsis - Will create a new hook when *state=present* and no given Hook is found. - Will update an existing hook when *state=present* and a Hook is found, but current and provided parameters differ. - Will delete the hook when *state=absent* and a Hook is found. +- Prior to release 5.0.0 this module was called ``community.aws.ec2_asg_lifecycle_hook``. The usage did not change. @@ -192,7 +193,7 @@ Parameters
The amount of time, in seconds, that can elapse before the lifecycle hook times out. When the lifecycle hook times out, Auto Scaling performs the default action. You can prevent the lifecycle hook from timing out by calling RecordLifecycleActionHeartbeat.
-
By default Amazon AWS will use 3600 (1 hour)
+
By default Amazon AWS will use 3600 (1 hour).
@@ -387,7 +388,7 @@ Examples .. code-block:: yaml - name: Create / Update lifecycle hook - community.aws.ec2_asg_lifecycle_hook: + community.aws.autoscaling_lifecycle_hook: region: eu-central-1 state: present autoscaling_group_name: example @@ -397,7 +398,7 @@ Examples default_result: ABANDON - name: Delete lifecycle hook - community.aws.ec2_asg_lifecycle_hook: + community.aws.autoscaling_lifecycle_hook: region: eu-central-1 state: absent autoscaling_group_name: example @@ -428,7 +429,7 @@ Common return values are documented `here success -
The unique name of the auto scaling group
+
The unique name of the auto scaling group.

Sample:
myasg
@@ -445,7 +446,7 @@ Common return values are documented `here success -
Defines the action the Auto Scaling group should take when the lifecycle hook timeout elapses or if an unexpected failure occurs
+
Defines the action the Auto Scaling group should take when the lifecycle hook timeout elapses or if an unexpected failure occurs.

Sample:
CONTINUE
@@ -462,7 +463,7 @@ Common return values are documented `here success -
The maximum time, in seconds, that an instance can remain in a Pending:Wait or Terminating:Wait state
+
The maximum time, in seconds, that an instance can remain in a Pending:Wait or Terminating:Wait state.

Sample:
172800
@@ -479,7 +480,7 @@ Common return values are documented `here success -
The maximum time, in seconds, that can elapse before the lifecycle hook times out
+
The maximum time, in seconds, that can elapse before the lifecycle hook times out.

Sample:
3600
@@ -496,7 +497,7 @@ Common return values are documented `here success -
The name of the lifecycle hook
+
The name of the lifecycle hook.

Sample:
mylifecyclehook
@@ -513,7 +514,7 @@ Common return values are documented `here success -
The instance state to which lifecycle hook should be attached
+
The instance state to which lifecycle hook should be attached.

Sample:
autoscaling:EC2_INSTANCE_LAUNCHING
diff --git a/docs/community.aws.ec2_scaling_policy_module.rst b/docs/community.aws.autoscaling_policy_module.rst similarity index 97% rename from docs/community.aws.ec2_scaling_policy_module.rst rename to docs/community.aws.autoscaling_policy_module.rst index 5d3340687a0..7ea0c8b0472 100644 --- a/docs/community.aws.ec2_scaling_policy_module.rst +++ b/docs/community.aws.autoscaling_policy_module.rst @@ -1,8 +1,8 @@ -.. _community.aws.ec2_scaling_policy_module: +.. _community.aws.autoscaling_policy_module: ******************************** -community.aws.ec2_scaling_policy +community.aws.autoscaling_policy ******************************** **Create or delete AWS scaling policies for Autoscaling groups** @@ -19,6 +19,7 @@ Synopsis -------- - Can create or delete scaling policies for autoscaling groups. - Referenced autoscaling groups must already exist. +- Prior to release 5.0.0 this module was called ``community.aws.ec2_scaling_policy``. The usage did not change. @@ -383,7 +384,7 @@ Parameters -
list of dicts containing lower_bound, upper_bound and scaling_adjustment
+
List of dicts containing lower_bound, upper_bound and scaling_adjustment.
Intervals must not overlap or have a gap between them.
At most, one item can have an undefined lower_bound. If any item has a negative lower_bound, then there must be a step adjustment with an undefined lower_bound.
At most, one item can have an undefined upper_bound. If any item has a positive upper_bound, then there must be a step adjustment with an undefined upper_bound.
@@ -479,7 +480,7 @@ Examples .. code-block:: yaml - name: Simple Scale Down policy - community.aws.ec2_scaling_policy: + community.aws.autoscaling_policy: state: present region: US-XXX name: "scaledown-policy" @@ -493,7 +494,7 @@ Examples # following creates a stepped policy: # From 20-40 (0-20 above threshold), increase by 50% of existing capacity # From 41-infinity, increase by 100% of existing capacity - - community.aws.ec2_scaling_policy: + - community.aws.autoscaling_policy: state: present region: US-XXX name: "step-scale-up-policy" @@ -532,7 +533,7 @@ Common return values are documented `here always -
Scaling policy adjustment type
+
Scaling policy adjustment type.

Sample:
PercentChangeInCapacity
@@ -549,7 +550,7 @@ Common return values are documented `here always -
Cloudwatch alarms related to the policy
+
Cloudwatch alarms related to the policy.

@@ -565,7 +566,7 @@ Common return values are documented `here always -
ARN of the Cloudwatch alarm
+
ARN of the Cloudwatch alarm.

Sample:
arn:aws:cloudwatch:us-east-2:1234567890:alarm:cpu-very-high
@@ -583,7 +584,7 @@ Common return values are documented `here always -
name of the Cloudwatch alarm
+
Name of the Cloudwatch alarm.

Sample:
cpu-very-high
@@ -601,7 +602,7 @@ Common return values are documented `here always -
ARN of the scaling policy. Provided for backward compatibility, value is the same as policy_arn
+
ARN of the scaling policy. Provided for backward compatibility, value is the same as policy_arn.

Sample:
arn:aws:autoscaling:us-east-2:123456789012:scalingPolicy:59e37526-bd27-42cf-adca-5cd3d90bc3b9:autoScalingGroupName/app-asg:policyName/app-policy
@@ -618,7 +619,7 @@ Common return values are documented `here always -
Auto Scaling Group name. Provided for backward compatibility, value is the same as auto_scaling_group_name
+
Auto Scaling Group name. Provided for backward compatibility, value is the same as auto_scaling_group_name.

Sample:
app-asg
@@ -635,7 +636,7 @@ Common return values are documented `here always -
Name of Auto Scaling Group
+
Name of Auto Scaling Group.

Sample:
app-asg
@@ -652,7 +653,7 @@ Common return values are documented `here when policy_type is StepScaling -
Method used to aggregate metrics
+
Method used to aggregate metrics.

Sample:
Maximum
@@ -669,7 +670,7 @@ Common return values are documented `here always -
Name of the scaling policy. Provided for backward compatibility, value is the same as policy_name
+
Name of the scaling policy. Provided for backward compatibility, value is the same as policy_name.

Sample:
app-policy
@@ -703,7 +704,7 @@ Common return values are documented `here always -
Name of scaling policy
+
Name of scaling policy.

Sample:
app-policy
@@ -720,7 +721,7 @@ Common return values are documented `here always -
Type of auto scaling policy
+
Type of auto scaling policy.

Sample:
StepScaling
@@ -737,7 +738,7 @@ Common return values are documented `here When policy_type is SimpleScaling -
Adjustment to make when alarm is triggered
+
Adjustment to make when alarm is triggered.

Sample:
1
@@ -754,7 +755,7 @@ Common return values are documented `here always -
List of step adjustments
+
List of step adjustments.

@@ -770,7 +771,7 @@ Common return values are documented `here if step has a lower bound -
Lower bound for metric interval
+
Lower bound for metric interval.

Sample:
20.0
@@ -788,7 +789,7 @@ Common return values are documented `here if step has an upper bound -
Upper bound for metric interval
+
Upper bound for metric interval.

Sample:
40.0
@@ -806,7 +807,7 @@ Common return values are documented `here always -
Adjustment to make if this step is reached
+
Adjustment to make if this step is reached.

Sample:
50
diff --git a/docs/community.aws.ec2_asg_scheduled_action_module.rst b/docs/community.aws.autoscaling_scheduled_action_module.rst similarity index 98% rename from docs/community.aws.ec2_asg_scheduled_action_module.rst rename to docs/community.aws.autoscaling_scheduled_action_module.rst index 30c502c805c..37984032091 100644 --- a/docs/community.aws.ec2_asg_scheduled_action_module.rst +++ b/docs/community.aws.autoscaling_scheduled_action_module.rst @@ -1,11 +1,11 @@ -.. _community.aws.ec2_asg_scheduled_action_module: +.. _community.aws.autoscaling_scheduled_action_module: -************************************** -community.aws.ec2_asg_scheduled_action -************************************** +****************************************** +community.aws.autoscaling_scheduled_action +****************************************** -**Create, modify and delete ASG scheduled scaling actions.** +**Create, modify and delete ASG scheduled scaling actions** Version added: 2.2.0 @@ -20,6 +20,7 @@ Synopsis - The module will create a new scheduled action when *state=present* and no given action is found. - The module will update a new scheduled action when *state=present* and the given action is found. - The module will delete a new scheduled action when *state=absent* and the given action is found. +- Prior to release 5.0.0 this module was called ``community.aws.ec2_asg_scheduled_action``. The usage did not change. @@ -391,7 +392,7 @@ Examples # Create a scheduled action for a autoscaling group. - name: Create a minimal scheduled action for autoscaling group - community.aws.ec2_asg_scheduled_action: + community.aws.autoscaling_scheduled_action: region: eu-west-1 autoscaling_group_name: test_asg scheduled_action_name: test_scheduled_action @@ -402,7 +403,7 @@ Examples register: scheduled_action - name: Create a scheduled action for autoscaling group - community.aws.ec2_asg_scheduled_action: + community.aws.autoscaling_scheduled_action: region: eu-west-1 autoscaling_group_name: test_asg scheduled_action_name: test_scheduled_action @@ -417,7 +418,7 @@ Examples register: scheduled_action - name: Delete scheduled action - community.aws.ec2_asg_scheduled_action: + community.aws.autoscaling_scheduled_action: region: eu-west-1 autoscaling_group_name: test_asg scheduled_action_name: test_scheduled_action diff --git a/docs/community.aws.ec2_launch_template_module.rst b/docs/community.aws.ec2_launch_template_module.rst index b9f76e7a7c1..7d6ca2130bc 100644 --- a/docs/community.aws.ec2_launch_template_module.rst +++ b/docs/community.aws.ec2_launch_template_module.rst @@ -18,7 +18,7 @@ Version added: 1.0.0 Synopsis -------- - Create, modify, and delete EC2 Launch Templates, which can be used to create individual instances or with Autoscaling Groups. -- The :ref:`amazon.aws.ec2_instance ` and :ref:`community.aws.ec2_asg ` modules can, instead of specifying all parameters on those tasks, be passed a Launch Template which contains settings like instance size, disk type, subnet, and more. +- The :ref:`amazon.aws.ec2_instance ` and :ref:`community.aws.autoscaling_group ` modules can, instead of specifying all parameters on those tasks, be passed a Launch Template which contains settings like instance size, disk type, subnet, and more. diff --git a/plugins/modules/autoscaling_group.py b/plugins/modules/autoscaling_group.py index 0aa16aeaa0b..0a4956487e0 100644 --- a/plugins/modules/autoscaling_group.py +++ b/plugins/modules/autoscaling_group.py @@ -8,13 +8,16 @@ DOCUMENTATION = r''' --- -module: ec2_asg +module: autoscaling_group version_added: 1.0.0 short_description: Create or delete AWS AutoScaling Groups (ASGs) description: - Can create or delete AWS AutoScaling Groups. - - Can be used with the M(community.aws.ec2_lc) module to manage Launch Configurations. -author: "Gareth Rushgrove (@garethr)" + - Can be used with the M(community.aws.autoscaling_launch_config) module to manage Launch Configurations. + - Prior to release 5.0.0 this module was called C(community.aws.ec2_asg). + The usage did not change. +author: + - "Gareth Rushgrove (@garethr)" options: state: description: @@ -45,7 +48,7 @@ elements: str launch_config_name: description: - - Name of the Launch configuration to use for the group. See the community.aws.ec2_lc) module for managing these. + - Name of the Launch configuration to use for the group. See the community.aws.autoscaling_launch_config) module for managing these. - If unspecified then the current group value will be used. One of I(launch_config_name) or I(launch_template) must be provided. type: str launch_template: @@ -318,15 +321,14 @@ type: list elements: str extends_documentation_fragment: -- amazon.aws.aws -- amazon.aws.ec2 - + - amazon.aws.aws + - amazon.aws.ec2 ''' EXAMPLES = r''' # Basic configuration with Launch Configuration -- community.aws.ec2_asg: +- community.aws.autoscaling_group: name: special load_balancers: [ 'lb1', 'lb2' ] availability_zones: [ 'eu-west-1a', 'eu-west-1b' ] @@ -352,7 +354,7 @@ # will have the current launch configuration. - name: create launch config - community.aws.ec2_lc: + community.aws.autoscaling_launch_config: name: my_new_lc image_id: ami-lkajsf key_name: mykey @@ -361,7 +363,7 @@ instance_type: m1.small assign_public_ip: yes -- community.aws.ec2_asg: +- community.aws.autoscaling_group: name: myasg launch_config_name: my_new_lc health_check_period: 60 @@ -375,7 +377,7 @@ # To only replace a couple of instances instead of all of them, supply a list # to "replace_instances": -- community.aws.ec2_asg: +- community.aws.autoscaling_group: name: myasg launch_config_name: my_new_lc health_check_period: 60 @@ -390,7 +392,7 @@ # Basic Configuration with Launch Template -- community.aws.ec2_asg: +- community.aws.autoscaling_group: name: special load_balancers: [ 'lb1', 'lb2' ] availability_zones: [ 'eu-west-1a', 'eu-west-1b' ] @@ -408,7 +410,7 @@ # Basic Configuration with Launch Template using mixed instance policy -- community.aws.ec2_asg: +- community.aws.autoscaling_group: name: special load_balancers: [ 'lb1', 'lb2' ] availability_zones: [ 'eu-west-1a', 'eu-west-1b' ] @@ -508,7 +510,7 @@ launch_config_name: description: > Name of launch configuration associated with the ASG. Same as launch_configuration_name, - provided for compatibility with ec2_asg module. + provided for compatibility with M(community.aws.autoscaling_group) module. returned: success type: str sample: "public-webapp-production-1" diff --git a/plugins/modules/autoscaling_group_info.py b/plugins/modules/autoscaling_group_info.py index 55d463e096b..4db9ac26a37 100644 --- a/plugins/modules/autoscaling_group_info.py +++ b/plugins/modules/autoscaling_group_info.py @@ -8,12 +8,15 @@ DOCUMENTATION = ''' --- -module: ec2_asg_info +module: autoscaling_group_info version_added: 1.0.0 -short_description: Gather information about ec2 Auto Scaling Groups (ASGs) in AWS +short_description: Gather information about EC2 Auto Scaling Groups (ASGs) in AWS description: - - Gather information about ec2 Auto Scaling Groups (ASGs) in AWS -author: "Rob White (@wimnat)" + - Gather information about EC2 Auto Scaling Groups (ASGs) in AWS. + - Prior to release 5.0.0 this module was called C(community.aws.ec2_asg_info). + The usage did not change. +author: + - "Rob White (@wimnat)" options: name: description: @@ -29,45 +32,44 @@ required: false type: dict extends_documentation_fragment: -- amazon.aws.aws -- amazon.aws.ec2 - + - amazon.aws.aws + - amazon.aws.ec2 ''' EXAMPLES = ''' # Note: These examples do not set authentication details, see the AWS Guide for details. - name: Find all groups - community.aws.ec2_asg_info: + community.aws.autoscaling_group_info: register: asgs - name: Find a group with matching name/prefix - community.aws.ec2_asg_info: + community.aws.autoscaling_group_info: name: public-webserver-asg register: asgs - name: Find a group with matching tags - community.aws.ec2_asg_info: + community.aws.autoscaling_group_info: tags: project: webapp env: production register: asgs - name: Find a group with matching name/prefix and tags - community.aws.ec2_asg_info: + community.aws.autoscaling_group_info: name: myproject tags: env: production register: asgs - name: Fail if no groups are found - community.aws.ec2_asg_info: + community.aws.autoscaling_group_info: name: public-webserver-asg register: asgs failed_when: "{{ asgs.results | length == 0 }}" - name: Fail if more than 1 group is found - community.aws.ec2_asg_info: + community.aws.autoscaling_group_info: name: public-webserver-asg register: asgs failed_when: "{{ asgs.results | length > 1 }}" @@ -132,7 +134,7 @@ launch_config_name: description: > Name of launch configuration associated with the ASG. Same as launch_configuration_name, - provided for compatibility with ec2_asg module. + provided for compatibility with M(community.aws.autoscaling_group) module. returned: success type: str sample: "public-webapp-production-1" @@ -401,7 +403,7 @@ def find_asgs(conn, module, name=None, tags=None): if matched_name and matched_tags: asg = camel_dict_to_snake_dict(asg) - # compatibility with ec2_asg module + # compatibility with autoscaling_group module if 'launch_configuration_name' in asg: asg['launch_config_name'] = asg['launch_configuration_name'] # workaround for https://github.com/ansible/ansible/pull/25015 diff --git a/plugins/modules/autoscaling_instance_refresh.py b/plugins/modules/autoscaling_instance_refresh.py index faa61fa74cb..43ef665e3f3 100644 --- a/plugins/modules/autoscaling_instance_refresh.py +++ b/plugins/modules/autoscaling_instance_refresh.py @@ -8,13 +8,16 @@ DOCUMENTATION = ''' --- -module: ec2_asg_instance_refresh +module: autoscaling_instance_refresh version_added: 3.2.0 short_description: Start or cancel an EC2 Auto Scaling Group (ASG) instance refresh in AWS description: - Start or cancel an EC2 Auto Scaling Group instance refresh in AWS. - - Can be used with M(community.aws.ec2_asg_instance_refresh_info) to track the subsequent progress. -author: "Dan Khersonsky (@danquixote)" + - Can be used with M(community.aws.autoscaling_instance_refresh_info) to track the subsequent progress. + - Prior to release 5.0.0 this module was called C(community.aws.ec2_asg_instance_refresh). + The usage did not change. +author: + - "Dan Khersonsky (@danquixote)" options: state: description: @@ -58,26 +61,25 @@ type: int type: dict extends_documentation_fragment: -- amazon.aws.aws -- amazon.aws.ec2 - + - amazon.aws.aws + - amazon.aws.ec2 ''' EXAMPLES = ''' # Note: These examples do not set authentication details, see the AWS Guide for details. - name: Start a refresh - community.aws.ec2_asg_instance_refresh: + community.aws.autoscaling_instance_refresh: name: some-asg state: started - name: Cancel a refresh - community.aws.ec2_asg_instance_refresh: + community.aws.autoscaling_instance_refresh: name: some-asg state: cancelled - name: Start a refresh and pass preferences - community.aws.ec2_asg_instance_refresh: + community.aws.autoscaling_instance_refresh: name: some-asg state: started preferences: diff --git a/plugins/modules/autoscaling_instance_refresh_info.py b/plugins/modules/autoscaling_instance_refresh_info.py index d4a12380098..e49743edd90 100644 --- a/plugins/modules/autoscaling_instance_refresh_info.py +++ b/plugins/modules/autoscaling_instance_refresh_info.py @@ -10,12 +10,14 @@ DOCUMENTATION = ''' --- -module: ec2_asg_instance_refresh_info +module: autoscaling_instance_refresh_info version_added: 3.2.0 -short_description: Gather information about ec2 Auto Scaling Group (ASG) Instance Refreshes in AWS +short_description: Gather information about EC2 Auto Scaling Group (ASG) Instance Refreshes in AWS description: - Describes one or more instance refreshes. - You can determine the status of a request by looking at the I(status) parameter. + - Prior to release 5.0.0 this module was called C(community.aws.ec2_asg_instance_refresh_info). + The usage did not change. author: "Dan Khersonsky (@danquixote)" options: name: @@ -39,32 +41,31 @@ type: int required: false extends_documentation_fragment: -- amazon.aws.aws -- amazon.aws.ec2 - + - amazon.aws.aws + - amazon.aws.ec2 ''' EXAMPLES = ''' # Note: These examples do not set authentication details, see the AWS Guide for details. - name: Find an refresh by ASG name - community.aws.ec2_asg_instance_refresh_info: + community.aws.autoscaling_instance_refresh_info: name: somename-asg - name: Find an refresh by ASG name and one or more refresh-IDs - community.aws.ec2_asg_instance_refresh_info: + community.aws.autoscaling_instance_refresh_info: name: somename-asg ids: ['some-id-123'] register: asgs - name: Find an refresh by ASG name and set max_records - community.aws.ec2_asg_instance_refresh_info: + community.aws.autoscaling_instance_refresh_info: name: somename-asg max_records: 4 register: asgs - name: Find an refresh by ASG name and NextToken, if received from a previous call - community.aws.ec2_asg_instance_refresh_info: + community.aws.autoscaling_instance_refresh_info: name: somename-asg next_token: 'some-token-123' register: asgs @@ -84,17 +85,14 @@ sample: "public-webapp-production-1" status: description: - - The current state of the group when DeleteAutoScalingGroup is in progress. - - The following are the possible statuses - - Pending -- The request was created, but the operation has not started. - - InProgress -- The operation is in progress. - - Successful -- The operation completed successfully. - - Failed -- The operation failed to complete. You can troubleshoot using the status reason and the scaling activities. - - Cancelling -- - - An ongoing operation is being cancelled. - - Cancellation does not roll back any replacements that have already been completed, - - but it prevents new replacements from being started. - - Cancelled -- The operation is cancelled. + - The current state of the group when DeleteAutoScalingGroup is in progress. + - The following are the possible statuses + - 'C(Pending): The request was created, but the operation has not started.' + - 'C(InProgress): The operation is in progress.' + - 'C(Successful): The operation completed successfully.' + - 'C(Failed): The operation failed to complete. You can troubleshoot using the status reason and the scaling activities.' + - 'C(Cancelling): An ongoing operation is being cancelled. Cancellation does not roll back any replacements that have already been completed, but it prevents new replacements from being started.' + - 'C(Cancelled): The operation is cancelled.' returned: success type: str sample: "Pending" diff --git a/plugins/modules/autoscaling_launch_config.py b/plugins/modules/autoscaling_launch_config.py index 4b383f7279c..f1a014a563e 100644 --- a/plugins/modules/autoscaling_launch_config.py +++ b/plugins/modules/autoscaling_launch_config.py @@ -9,20 +9,21 @@ DOCUMENTATION = r''' --- -module: ec2_lc +module: autoscaling_launch_config version_added: 1.0.0 short_description: Create or delete AWS Autoscaling Launch Configurations description: - Can create or delete AWS Autoscaling Configurations. - - Works with the ec2_asg module to manage Autoscaling Groups. + - Works with the M(community.aws.autoscaling_group) module to manage Autoscaling Groups. + - Prior to release 5.0.0 this module was called C(community.aws.ec2_lc). + The usage did not change. notes: - Amazon ASG Autoscaling Launch Configurations are immutable once created, so modifying the configuration after it is changed will not modify the launch configuration on AWS. You must create a new config and assign it to the ASG instead. - author: - "Gareth Rushgrove (@garethr)" - "Willem van Ketwich (@wilvk)" @@ -54,14 +55,14 @@ type: str security_groups: description: - - A list of security groups to apply to the instances. Since version 2.4 you can specify either security group names or IDs or a mix. Previous - to 2.4, for VPC instances, specify security group IDs and for EC2-Classic, specify either security group names or IDs. + - A list of security groups to apply to the instances. + - You can specify either security group names or IDs or a mix. type: list elements: str volumes: description: - A list dictionaries defining the volumes to create. - - For any volume, a volume size less than 1 will be interpreted as a request not to create the volume. + - For any volume, a volume size less than C(1) will be interpreted as a request not to create the volume. type: list elements: dict suboptions: @@ -180,17 +181,15 @@ - When not set AWS will default to C(default). type: str choices: ['default', 'dedicated'] - extends_documentation_fragment: -- amazon.aws.aws -- amazon.aws.ec2 - + - amazon.aws.aws + - amazon.aws.ec2 ''' EXAMPLES = r''' - name: create a launch configuration with an encrypted volume - community.aws.ec2_lc: + community.aws.autoscaling_launch_config: name: special image_id: ami-XXX key_name: default @@ -207,7 +206,7 @@ ephemeral: ephemeral0 - name: create a launch configuration using a running instance id as a basis - community.aws.ec2_lc: + community.aws.autoscaling_launch_config: name: special instance_id: i-00a48b207ec59e948 key_name: default @@ -220,7 +219,7 @@ delete_on_termination: true - name: create a launch configuration to omit the /dev/sdf EBS device that is included in the AMI image - community.aws.ec2_lc: + community.aws.autoscaling_launch_config: name: special image_id: ami-XXX key_name: default @@ -244,7 +243,7 @@ encrypted: no - name: Create launch configuration - community.aws.ec2_lc: + community.aws.autoscaling_launch_config: name: lc1 image_id: ami-xxxx assign_public_ip: yes @@ -350,7 +349,7 @@ type: bool sample: true ebs_optimized: - description: Indicates whether the instance is optimized for EBS I/O (true) or not (false). + description: Indicates whether the instance is optimized for EBS I/O C(true) or not C(false). returned: when I(state=present) type: bool sample: false @@ -360,7 +359,7 @@ type: str sample: ami-9be6f38c instance_monitoring: - description: Indicates whether instances in this group are launched with detailed (true) or basic (false) monitoring. + description: Indicates whether instances in this group are launched with detailed C(true) or basic C(false) monitoring. returned: when I(state=present) type: bool sample: true @@ -439,7 +438,6 @@ type: list sample: - sg-5e27db2f - ''' diff --git a/plugins/modules/autoscaling_launch_config_find.py b/plugins/modules/autoscaling_launch_config_find.py index 3e525adc6cf..e1f8ec5308b 100644 --- a/plugins/modules/autoscaling_launch_config_find.py +++ b/plugins/modules/autoscaling_launch_config_find.py @@ -10,15 +10,17 @@ DOCUMENTATION = ''' --- -module: ec2_lc_find +module: autoscaling_launch_config_find version_added: 1.0.0 short_description: Find AWS Autoscaling Launch Configurations description: - Returns list of matching Launch Configurations for a given name, along with other useful information. - Results can be sorted and sliced. - - Based on the work by Tom Bamford U(https://github.com/tombamford) - -author: "Jose Armesto (@fiunchinho)" + - Based on the work by Tom Bamford U(https://github.com/tombamford). + - Prior to release 5.0.0 this module was called C(community.aws.ec2_lc_find). + The usage did not change. +author: + - "Jose Armesto (@fiunchinho)" options: name_regex: description: @@ -38,16 +40,15 @@ - Corresponds to Python slice notation like list[:limit]. type: int extends_documentation_fragment: -- amazon.aws.ec2 -- amazon.aws.aws - + - amazon.aws.ec2 + - amazon.aws.aws ''' EXAMPLES = ''' # Note: These examples do not set authentication details, see the AWS Guide for details. - name: Search for the Launch Configurations that start with "app" - community.aws.ec2_lc_find: + community.aws.autoscaling_launch_config_find: name_regex: app.* sort_order: descending limit: 2 diff --git a/plugins/modules/autoscaling_launch_config_info.py b/plugins/modules/autoscaling_launch_config_info.py index d05bf9876b4..7a9cfae9ad1 100644 --- a/plugins/modules/autoscaling_launch_config_info.py +++ b/plugins/modules/autoscaling_launch_config_info.py @@ -9,12 +9,15 @@ DOCUMENTATION = r''' --- -module: ec2_lc_info +module: autoscaling_launch_config_info version_added: 1.0.0 -short_description: Gather information about AWS Autoscaling Launch Configurations. +short_description: Gather information about AWS Autoscaling Launch Configurations description: - - Gather information about AWS Autoscaling Launch Configurations. -author: "Loïc Latreille (@psykotox)" + - Gather information about AWS Autoscaling Launch Configurations. + - Prior to release 5.0.0 this module was called C(community.aws.ec2_lc_info). + The usage did not change. +author: + - "Loïc Latreille (@psykotox)" options: name: description: @@ -45,30 +48,29 @@ - Corresponds to Python slice notation. type: int extends_documentation_fragment: -- amazon.aws.aws -- amazon.aws.ec2 - + - amazon.aws.aws + - amazon.aws.ec2 ''' EXAMPLES = r''' # Note: These examples do not set authentication details, see the AWS Guide for details. - name: Gather information about all launch configurations - community.aws.ec2_lc_info: + community.aws.autoscaling_launch_config_info: - name: Gather information about launch configuration with name "example" - community.aws.ec2_lc_info: + community.aws.autoscaling_launch_config_info: name: example - name: Gather information sorted by created_time from most recent to least recent - community.aws.ec2_lc_info: + community.aws.autoscaling_launch_config_info: sort: created_time sort_order: descending ''' RETURN = r''' block_device_mapping: - description: Block device mapping for the instances of launch configuration + description: Block device mapping for the instances of launch configuration. type: list returned: always sample: "[{ @@ -79,74 +81,73 @@ 'volume_type': 'gp2' }]" classic_link_vpc_security_groups: - description: IDs of one or more security groups for the VPC specified in classic_link_vpc_id + description: IDs of one or more security groups for the VPC specified in classic_link_vpc_id. type: str returned: always sample: created_time: - description: The creation date and time for the launch configuration + description: The creation date and time for the launch configuration. type: str returned: always sample: "2016-05-27T13:47:44.216000+00:00" ebs_optimized: - description: EBS I/O optimized (true ) or not (false ) + description: EBS I/O optimized C(true) or not C(false). type: bool returned: always sample: true, image_id: - description: ID of the Amazon Machine Image (AMI) + description: ID of the Amazon Machine Image (AMI). type: str returned: always sample: "ami-12345678" instance_monitoring: - description: Launched with detailed monitoring or not + description: Launched with detailed monitoring or not. type: dict returned: always sample: "{ 'enabled': true }" instance_type: - description: Instance type + description: Instance type. type: str returned: always sample: "t2.micro" kernel_id: - description: ID of the kernel associated with the AMI + description: ID of the kernel associated with the AMI. type: str returned: always sample: key_name: - description: Name of the key pair + description: Name of the key pair. type: str returned: always sample: "user_app" launch_configuration_arn: - description: Amazon Resource Name (ARN) of the launch configuration + description: Amazon Resource Name (ARN) of the launch configuration. type: str returned: always sample: "arn:aws:autoscaling:us-east-1:666612345678:launchConfiguration:ba785e3a-dd42-6f02-4585-ea1a2b458b3d:launchConfigurationName/lc-app" launch_configuration_name: - description: Name of the launch configuration + description: Name of the launch configuration. type: str returned: always sample: "lc-app" ramdisk_id: - description: ID of the RAM disk associated with the AMI + description: ID of the RAM disk associated with the AMI. type: str returned: always sample: security_groups: - description: Security groups to associated + description: Security groups to associated. type: list returned: always sample: "[ 'web' ]" user_data: - description: User data available + description: User data available. type: str returned: always - sample: ''' try: diff --git a/plugins/modules/autoscaling_lifecycle_hook.py b/plugins/modules/autoscaling_lifecycle_hook.py index 351bba5b84d..55d28932338 100644 --- a/plugins/modules/autoscaling_lifecycle_hook.py +++ b/plugins/modules/autoscaling_lifecycle_hook.py @@ -9,14 +9,17 @@ DOCUMENTATION = ''' --- -module: ec2_asg_lifecycle_hook +module: autoscaling_lifecycle_hook version_added: 1.0.0 -short_description: Create, delete or update AWS ASG Lifecycle Hooks. +short_description: Create, delete or update AWS ASG Lifecycle Hooks description: - Will create a new hook when I(state=present) and no given Hook is found. - Will update an existing hook when I(state=present) and a Hook is found, but current and provided parameters differ. - Will delete the hook when I(state=absent) and a Hook is found. -author: Igor 'Tsigankov' Eyrich (@tsiganenok) + - Prior to release 5.0.0 this module was called C(community.aws.ec2_asg_lifecycle_hook). + The usage did not change. +author: + - Igor 'Tsigankov' Eyrich (@tsiganenok) options: state: description: @@ -61,7 +64,7 @@ - The amount of time, in seconds, that can elapse before the lifecycle hook times out. When the lifecycle hook times out, Auto Scaling performs the default action. You can prevent the lifecycle hook from timing out by calling RecordLifecycleActionHeartbeat. - - By default Amazon AWS will use 3600 (1 hour) + - By default Amazon AWS will use C(3600) (1 hour). type: int default_result: description: @@ -71,14 +74,13 @@ default: ABANDON type: str extends_documentation_fragment: -- amazon.aws.aws -- amazon.aws.ec2 - + - amazon.aws.aws + - amazon.aws.ec2 ''' EXAMPLES = ''' - name: Create / Update lifecycle hook - community.aws.ec2_asg_lifecycle_hook: + community.aws.autoscaling_lifecycle_hook: region: eu-central-1 state: present autoscaling_group_name: example @@ -88,43 +90,42 @@ default_result: ABANDON - name: Delete lifecycle hook - community.aws.ec2_asg_lifecycle_hook: + community.aws.autoscaling_lifecycle_hook: region: eu-central-1 state: absent autoscaling_group_name: example lifecycle_hook_name: example - ''' RETURN = ''' --- auto_scaling_group_name: - description: The unique name of the auto scaling group + description: The unique name of the auto scaling group. returned: success type: str sample: "myasg" default_result: - description: Defines the action the Auto Scaling group should take when the lifecycle hook timeout elapses or if an unexpected failure occurs + description: Defines the action the Auto Scaling group should take when the lifecycle hook timeout elapses or if an unexpected failure occurs. returned: success type: str sample: CONTINUE global_timeout: - description: The maximum time, in seconds, that an instance can remain in a Pending:Wait or Terminating:Wait state + description: The maximum time, in seconds, that an instance can remain in a C(Pending:Wait) or C(Terminating:Wait) state. returned: success type: int sample: 172800 heartbeat_timeout: - description: The maximum time, in seconds, that can elapse before the lifecycle hook times out + description: The maximum time, in seconds, that can elapse before the lifecycle hook times out. returned: success type: int sample: 3600 lifecycle_hook_name: - description: The name of the lifecycle hook + description: The name of the lifecycle hook. returned: success type: str sample: "mylifecyclehook" lifecycle_transition: - description: The instance state to which lifecycle hook should be attached + description: The instance state to which lifecycle hook should be attached. returned: success type: str sample: "autoscaling:EC2_INSTANCE_LAUNCHING" diff --git a/plugins/modules/autoscaling_policy.py b/plugins/modules/autoscaling_policy.py index 7aeabd1d7da..f79cbafb43a 100644 --- a/plugins/modules/autoscaling_policy.py +++ b/plugins/modules/autoscaling_policy.py @@ -7,12 +7,14 @@ DOCUMENTATION = r''' -module: ec2_scaling_policy +module: autoscaling_policy short_description: Create or delete AWS scaling policies for Autoscaling groups version_added: 1.0.0 description: - Can create or delete scaling policies for autoscaling groups. - Referenced autoscaling groups must already exist. + - Prior to release 5.0.0 this module was called C(community.aws.ec2_scaling_policy). + The usage did not change. author: - Zacharie Eakin (@zeekin) - Will Thames (@willthames) @@ -81,7 +83,7 @@ step_adjustments: type: list description: - - list of dicts containing I(lower_bound), I(upper_bound) and I(scaling_adjustment) + - List of dicts containing I(lower_bound), I(upper_bound) and I(scaling_adjustment). - Intervals must not overlap or have a gap between them. - At most, one item can have an undefined I(lower_bound). If any item has a negative lower_bound, then there must be a step adjustment with an undefined I(lower_bound). @@ -112,13 +114,12 @@ description: - The estimated time, in seconds, until a newly launched instance can contribute to the CloudWatch metrics. extends_documentation_fragment: -- amazon.aws.aws -- amazon.aws.ec2 - + - amazon.aws.aws + - amazon.aws.ec2 ''' EXAMPLES = ''' - name: Simple Scale Down policy - community.aws.ec2_scaling_policy: + community.aws.autoscaling_policy: state: present region: US-XXX name: "scaledown-policy" @@ -132,7 +133,7 @@ # following creates a stepped policy: # From 20-40 (0-20 above threshold), increase by 50% of existing capacity # From 41-infinity, increase by 100% of existing capacity -- community.aws.ec2_scaling_policy: +- community.aws.autoscaling_policy: state: present region: US-XXX name: "step-scale-up-policy" @@ -149,47 +150,47 @@ RETURN = ''' adjustment_type: - description: Scaling policy adjustment type + description: Scaling policy adjustment type. returned: always type: str sample: PercentChangeInCapacity alarms: - description: Cloudwatch alarms related to the policy + description: Cloudwatch alarms related to the policy. returned: always type: complex contains: alarm_name: - description: name of the Cloudwatch alarm + description: Name of the Cloudwatch alarm. returned: always type: str sample: cpu-very-high alarm_arn: - description: ARN of the Cloudwatch alarm + description: ARN of the Cloudwatch alarm. returned: always type: str sample: arn:aws:cloudwatch:us-east-2:1234567890:alarm:cpu-very-high arn: - description: ARN of the scaling policy. Provided for backward compatibility, value is the same as I(policy_arn) + description: ARN of the scaling policy. Provided for backward compatibility, value is the same as I(policy_arn). returned: always type: str sample: arn:aws:autoscaling:us-east-2:123456789012:scalingPolicy:59e37526-bd27-42cf-adca-5cd3d90bc3b9:autoScalingGroupName/app-asg:policyName/app-policy as_name: - description: Auto Scaling Group name. Provided for backward compatibility, value is the same as I(auto_scaling_group_name) + description: Auto Scaling Group name. Provided for backward compatibility, value is the same as I(auto_scaling_group_name). returned: always type: str sample: app-asg auto_scaling_group_name: - description: Name of Auto Scaling Group + description: Name of Auto Scaling Group. returned: always type: str sample: app-asg metric_aggregation_type: - description: Method used to aggregate metrics + description: Method used to aggregate metrics. returned: when I(policy_type) is C(StepScaling) type: str sample: Maximum name: - description: Name of the scaling policy. Provided for backward compatibility, value is the same as I(policy_name) + description: Name of the scaling policy. Provided for backward compatibility, value is the same as I(policy_name). returned: always type: str sample: app-policy @@ -199,37 +200,37 @@ type: str sample: arn:aws:autoscaling:us-east-2:123456789012:scalingPolicy:59e37526-bd27-42cf-adca-5cd3d90bc3b9:autoScalingGroupName/app-asg:policyName/app-policy policy_name: - description: Name of scaling policy + description: Name of scaling policy. returned: always type: str sample: app-policy policy_type: - description: Type of auto scaling policy + description: Type of auto scaling policy. returned: always type: str sample: StepScaling scaling_adjustment: - description: Adjustment to make when alarm is triggered + description: Adjustment to make when alarm is triggered. returned: When I(policy_type) is C(SimpleScaling) type: int sample: 1 step_adjustments: - description: List of step adjustments + description: List of step adjustments. returned: always type: complex contains: metric_interval_lower_bound: - description: Lower bound for metric interval + description: Lower bound for metric interval. returned: if step has a lower bound type: float sample: 20.0 metric_interval_upper_bound: - description: Upper bound for metric interval + description: Upper bound for metric interval. returned: if step has an upper bound type: float sample: 40.0 scaling_adjustment: - description: Adjustment to make if this step is reached + description: Adjustment to make if this step is reached. returned: always type: int sample: 50 diff --git a/plugins/modules/autoscaling_scheduled_action.py b/plugins/modules/autoscaling_scheduled_action.py index 5f41dc31b05..60c91403ff0 100644 --- a/plugins/modules/autoscaling_scheduled_action.py +++ b/plugins/modules/autoscaling_scheduled_action.py @@ -11,13 +11,15 @@ DOCUMENTATION = r''' --- -module: ec2_asg_scheduled_action +module: autoscaling_scheduled_action version_added: 2.2.0 -short_description: Create, modify and delete ASG scheduled scaling actions. +short_description: Create, modify and delete ASG scheduled scaling actions description: - The module will create a new scheduled action when I(state=present) and no given action is found. - The module will update a new scheduled action when I(state=present) and the given action is found. - The module will delete a new scheduled action when I(state=absent) and the given action is found. + - Prior to release 5.0.0 this module was called C(community.aws.ec2_asg_scheduled_action). + The usage did not change. options: autoscaling_group_name: description: @@ -74,7 +76,7 @@ EXAMPLES = r''' # Create a scheduled action for a autoscaling group. - name: Create a minimal scheduled action for autoscaling group - community.aws.ec2_asg_scheduled_action: + community.aws.autoscaling_scheduled_action: region: eu-west-1 autoscaling_group_name: test_asg scheduled_action_name: test_scheduled_action @@ -85,7 +87,7 @@ register: scheduled_action - name: Create a scheduled action for autoscaling group - community.aws.ec2_asg_scheduled_action: + community.aws.autoscaling_scheduled_action: region: eu-west-1 autoscaling_group_name: test_asg scheduled_action_name: test_scheduled_action @@ -100,12 +102,13 @@ register: scheduled_action - name: Delete scheduled action - community.aws.ec2_asg_scheduled_action: + community.aws.autoscaling_scheduled_action: region: eu-west-1 autoscaling_group_name: test_asg scheduled_action_name: test_scheduled_action state: absent ''' + RETURN = r''' scheduled_action_name: description: The name of the scheduled action. diff --git a/plugins/modules/ec2_launch_template.py b/plugins/modules/ec2_launch_template.py index 9e7bcd7cda2..85fd8d6e9c5 100644 --- a/plugins/modules/ec2_launch_template.py +++ b/plugins/modules/ec2_launch_template.py @@ -13,7 +13,7 @@ description: - Create, modify, and delete EC2 Launch Templates, which can be used to create individual instances or with Autoscaling Groups. -- The M(amazon.aws.ec2_instance) and M(community.aws.ec2_asg) modules can, instead of specifying all +- The M(amazon.aws.ec2_instance) and M(community.aws.autoscaling_group) modules can, instead of specifying all parameters on those tasks, be passed a Launch Template which contains settings like instance size, disk type, subnet, and more. extends_documentation_fragment: diff --git a/test-requirements.txt b/test-requirements.txt index b3005cf8205..5220132453d 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,7 +1,7 @@ botocore boto3 -python-dateutil # Used by ec2_asg_scheduled_action +python-dateutil # Used by autoscaling_scheduled_action coverage==4.5.4 placebo From 73470ba7b05b965b4972b6b2901c5c4c4a1bdadc Mon Sep 17 00:00:00 2001 From: Mark Chappell Date: Fri, 1 Jul 2022 17:04:48 +0200 Subject: [PATCH 3/4] changelog --- changelogs/fragments/1294-rename_autoscaling.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 changelogs/fragments/1294-rename_autoscaling.yml diff --git a/changelogs/fragments/1294-rename_autoscaling.yml b/changelogs/fragments/1294-rename_autoscaling.yml new file mode 100644 index 00000000000..b95f85ae59e --- /dev/null +++ b/changelogs/fragments/1294-rename_autoscaling.yml @@ -0,0 +1,11 @@ +minor_changes: +- ec2_asg - the ``ec2_asg`` module has been renamed to ``autoscaling_group``, ``ec2_asg`` remains as an alias (https://github.com/ansible-collections/community.aws/pull/1294). +- ec2_asg_info - the ``ec2_asg_info`` module has been renamed to ``autoscaling_group_info``, ``ec2_asg_info`` remains as an alias (https://github.com/ansible-collections/community.aws/pull/1294). +- ec2_asg_instance_refresh - the ``ec2_asg_instance_refresh`` module has been renamed to ``autoscaling_instance_refresh``, ``ec2_asg_instance_refresh`` remains as an alias (https://github.com/ansible-collections/community.aws/pull/1294). +- ec2_asg_instance_refresh_info - the ``ec2_asg_instance_refresh_info`` module has been renamed to ``autoscaling_instance_refresh_info``, ``ec2_asg_instance_refresh_info`` remains as an alias (https://github.com/ansible-collections/community.aws/pull/1294). +- ec2_asg_lifecycle_hook - the ``ec2_asg_lifecycle_hook`` module has been renamed to ``autoscaling_lifecycle_hool``, ``ec2_asg_lifecycle_hook`` remains as an alias (https://github.com/ansible-collections/community.aws/pull/1294). +- ec2_asg_scheduled_action - the ``ec2_asg_scheduled_action`` module has been renamed to ``autoscaling_scheduled_action``, ``ec2_asg_scheduled_action`` remains as an alias (https://github.com/ansible-collections/community.aws/pull/1294). +- ec2_lc - the ``ec2_lc`` module has been renamed to ``autoscaling_launch_config``, ``ec2_lc`` remains as an alias (https://github.com/ansible-collections/community.aws/pull/1294). +- ec2_lc_info - the ``ec2_lc_info`` module has been renamed to ``autoscaling_launch_config_info``, ``ec2_lc_info`` remains as an alias (https://github.com/ansible-collections/community.aws/pull/1294). +- ec2_lc_find - the ``ec2_lc_find`` module has been renamed to ``autoscaling_launch_config_find``, ``ec2_lc_find`` remains as an alias (https://github.com/ansible-collections/community.aws/pull/1294). +- ec2_scaling_policy - the ``ec2_scaling_policy`` module has been renamed to ``autoscaling_policy``, ``ec2_scaling_policy`` remains as an alias (https://github.com/ansible-collections/community.aws/pull/1294). From ceeffbce9cbfeaffab9b83ae82475e644cb57fe6 Mon Sep 17 00:00:00 2001 From: Mark Chappell Date: Fri, 1 Jul 2022 18:31:40 +0200 Subject: [PATCH 4/4] lint --- ...s.autoscaling_instance_refresh_info_module.rst | 12 ++++++------ plugins/modules/autoscaling_group.py | 1 - .../modules/autoscaling_instance_refresh_info.py | 15 +++++++++------ 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/docs/community.aws.autoscaling_instance_refresh_info_module.rst b/docs/community.aws.autoscaling_instance_refresh_info_module.rst index 316d1fd560b..025aa3bf9a9 100644 --- a/docs/community.aws.autoscaling_instance_refresh_info_module.rst +++ b/docs/community.aws.autoscaling_instance_refresh_info_module.rst @@ -448,12 +448,12 @@ Common return values are documented `here
The current state of the group when DeleteAutoScalingGroup is in progress.
The following are the possible statuses
-
Pending: The request was created, but the operation has not started.
-
InProgress: The operation is in progress.
-
Successful: The operation completed successfully.
-
Failed: The operation failed to complete. You can troubleshoot using the status reason and the scaling activities.
-
Cancelling: An ongoing operation is being cancelled. Cancellation does not roll back any replacements that have already been completed, but it prevents new replacements from being started.
-
Cancelled: The operation is cancelled.
+
Pending - The request was created, but the operation has not started.
+
InProgress - The operation is in progress.
+
Successful - The operation completed successfully.
+
Failed - The operation failed to complete. You can troubleshoot using the status reason and the scaling activities.
+
Cancelling - An ongoing operation is being cancelled. Cancellation does not roll back any replacements that have already been completed, but it prevents new replacements from being started.
+
Cancelled - The operation is cancelled.'

Sample:
Pending
diff --git a/plugins/modules/autoscaling_group.py b/plugins/modules/autoscaling_group.py index 0a4956487e0..753f2a08727 100644 --- a/plugins/modules/autoscaling_group.py +++ b/plugins/modules/autoscaling_group.py @@ -654,7 +654,6 @@ from ansible_collections.amazon.aws.plugins.module_utils.ec2 import AWSRetry from ansible_collections.amazon.aws.plugins.module_utils.ec2 import snake_dict_to_camel_dict from ansible_collections.amazon.aws.plugins.module_utils.ec2 import camel_dict_to_snake_dict -from ansible_collections.amazon.aws.plugins.module_utils.ec2 import ansible_dict_to_boto3_filter_list ASG_ATTRIBUTES = ('AvailabilityZones', 'DefaultCooldown', 'DesiredCapacity', 'HealthCheckGracePeriod', 'HealthCheckType', 'LaunchConfigurationName', diff --git a/plugins/modules/autoscaling_instance_refresh_info.py b/plugins/modules/autoscaling_instance_refresh_info.py index e49743edd90..4d9cb7e05b7 100644 --- a/plugins/modules/autoscaling_instance_refresh_info.py +++ b/plugins/modules/autoscaling_instance_refresh_info.py @@ -87,12 +87,15 @@ description: - The current state of the group when DeleteAutoScalingGroup is in progress. - The following are the possible statuses - - 'C(Pending): The request was created, but the operation has not started.' - - 'C(InProgress): The operation is in progress.' - - 'C(Successful): The operation completed successfully.' - - 'C(Failed): The operation failed to complete. You can troubleshoot using the status reason and the scaling activities.' - - 'C(Cancelling): An ongoing operation is being cancelled. Cancellation does not roll back any replacements that have already been completed, but it prevents new replacements from being started.' - - 'C(Cancelled): The operation is cancelled.' + - C(Pending) - The request was created, but the operation has not started. + - C(InProgress) - The operation is in progress. + - C(Successful) - The operation completed successfully. + - C(Failed) - The operation failed to complete. + You can troubleshoot using the status reason and the scaling activities. + - C(Cancelling) - An ongoing operation is being cancelled. + Cancellation does not roll back any replacements that have already been + completed, but it prevents new replacements from being started. + - C(Cancelled) - The operation is cancelled.' returned: success type: str sample: "Pending"