diff --git a/changelogs/fragments/897-ec2_security_group.yml b/changelogs/fragments/897-ec2_security_group.yml new file mode 100644 index 00000000000..3e021f45480 --- /dev/null +++ b/changelogs/fragments/897-ec2_security_group.yml @@ -0,0 +1,3 @@ +minor_changes: +- ec2_group - The ``ec2_group`` module has been renamed to ``ec2_security_group``, ``ec2_group`` remains as an alias (https://github.com/ansible-collections/amazon.aws/pull/897). +- ec2_group_info - The ``ec2_group_info`` module has been renamed to ``ec2_security_group_info``, ``ec2_group_info`` remains as an alias (https://github.com/ansible-collections/amazon.aws/pull/897). diff --git a/meta/runtime.yml b/meta/runtime.yml index 092113c3873..9d35fdeb12b 100644 --- a/meta/runtime.yml +++ b/meta/runtime.yml @@ -17,6 +17,8 @@ action_groups: - ec2_instance - ec2_instance_info - ec2_key + - ec2_security_group + - ec2_security_group_info - ec2_snapshot - ec2_snapshot_info - ec2_spot_instance @@ -60,6 +62,12 @@ plugin_routing: redirect: amazon.aws.s3_object ec2_elb_lb: redirect: amazon.aws.elb_classic_lb + ec2_group: + # Deprecation for this alias should not *start* prior to 2024-09-01 + redirect: amazon.aws.ec2_security_group + ec2_group_info: + # Deprecation for this alias should not *start* prior to 2024-09-01 + redirect: amazon.aws.ec2_security_group_info ec2_eni_facts: deprecation: removal_date: 2021-12-01 diff --git a/plugins/modules/ec2_group.py b/plugins/modules/ec2_security_group.py similarity index 99% rename from plugins/modules/ec2_group.py rename to plugins/modules/ec2_security_group.py index 7de410f849e..d4ca561ef48 100644 --- a/plugins/modules/ec2_group.py +++ b/plugins/modules/ec2_security_group.py @@ -9,14 +9,14 @@ DOCUMENTATION = ''' --- -module: ec2_group +module: ec2_security_group version_added: 1.0.0 author: - "Andrew de Quincey (@adq)" - "Razique Mahroua (@Razique)" -short_description: Maintain an ec2 VPC security group +short_description: Maintain an EC2 security group description: - - Maintains ec2 security groups. + - Maintains EC2 security groups. options: name: description: @@ -246,12 +246,13 @@ - If a rule declares a group_name and that group doesn't exist, it will be automatically created. In that case, group_desc should be provided as well. The module will refuse to create a depended-on group without a description. - - Preview diff mode support is added in version 2.7. + - Prior to release 5.0.0 this module was called C(amazon.aws.ec2_group_info). The usage did not + change. ''' EXAMPLES = ''' - name: example using security group rule descriptions - amazon.aws.ec2_group: + amazon.aws.ec2_security_group: name: "{{ name }}" description: sg with rule descriptions vpc_id: vpc-xxxxxxxx @@ -265,7 +266,7 @@ rule_desc: allow all on port 80 - name: example using ICMP types and codes - amazon.aws.ec2_group: + amazon.aws.ec2_security_group: name: "{{ name }}" description: sg for ICMP vpc_id: vpc-xxxxxxxx @@ -278,7 +279,7 @@ cidr_ip: 0.0.0.0/0 - name: example ec2 group - amazon.aws.ec2_group: + amazon.aws.ec2_security_group: name: example description: an example EC2 group vpc_id: 12345 @@ -338,7 +339,7 @@ group_desc: other example EC2 group - name: example2 ec2 group - amazon.aws.ec2_group: + amazon.aws.ec2_security_group: name: example2 description: an example2 EC2 group vpc_id: 12345 @@ -378,7 +379,7 @@ diff: True - name: "Delete group by its id" - amazon.aws.ec2_group: + amazon.aws.ec2_security_group: region: eu-west-1 group_id: sg-33b4ee5b state: absent diff --git a/plugins/modules/ec2_group_info.py b/plugins/modules/ec2_security_group_info.py similarity index 93% rename from plugins/modules/ec2_group_info.py rename to plugins/modules/ec2_security_group_info.py index 5a117dfa14e..42e7aef704b 100644 --- a/plugins/modules/ec2_group_info.py +++ b/plugins/modules/ec2_security_group_info.py @@ -8,11 +8,11 @@ DOCUMENTATION = ''' --- -module: ec2_group_info +module: ec2_security_group_info version_added: 1.0.0 -short_description: Gather information about ec2 security groups in AWS +short_description: Gather information about EC2 security groups in AWS description: - - Gather information about ec2 security groups in AWS. + - Gather information about EC2 security groups in AWS. author: - Henrique Rodrigues (@Sodki) options: @@ -26,7 +26,10 @@ default: {} type: dict notes: - - By default, the module will return all security groups. To limit results use the appropriate filters. + - By default, the module will return all security groups in a region. To limit results use the + appropriate filters. + - Prior to release 5.0.0 this module was called C(amazon.aws.ec2_group_info). The usage did not + change. extends_documentation_fragment: - amazon.aws.aws @@ -38,36 +41,36 @@ # Note: These examples do not set authentication details, see the AWS Guide for details. # Gather information about all security groups -- amazon.aws.ec2_group_info: +- amazon.aws.ec2_security_group_info: # Gather information about all security groups in a specific VPC -- amazon.aws.ec2_group_info: +- amazon.aws.ec2_security_group_info: filters: vpc-id: vpc-12345678 # Gather information about all security groups in a specific VPC -- amazon.aws.ec2_group_info: +- amazon.aws.ec2_security_group_info: filters: vpc-id: vpc-12345678 # Gather information about a security group -- amazon.aws.ec2_group_info: +- amazon.aws.ec2_security_group_info: filters: group-name: example-1 # Gather information about a security group by id -- amazon.aws.ec2_group_info: +- amazon.aws.ec2_security_group_info: filters: group-id: sg-12345678 # Gather information about a security group with multiple filters, also mixing the use of underscores as filter keys -- amazon.aws.ec2_group_info: +- amazon.aws.ec2_security_group_info: filters: group_id: sg-12345678 vpc-id: vpc-12345678 # Gather information about various security groups -- amazon.aws.ec2_group_info: +- amazon.aws.ec2_security_group_info: filters: group-name: - example-1 @@ -76,7 +79,7 @@ # Gather information about any security group with a tag key Name and value Example. # The quotes around 'tag:name' are important because of the colon in the value -- amazon.aws.ec2_group_info: +- amazon.aws.ec2_security_group_info: filters: "tag:Name": Example ''' diff --git a/tests/integration/targets/ec2_group/aliases b/tests/integration/targets/ec2_security_group/aliases similarity index 57% rename from tests/integration/targets/ec2_group/aliases rename to tests/integration/targets/ec2_security_group/aliases index 75d0e08cacb..115fded97c7 100644 --- a/tests/integration/targets/ec2_group/aliases +++ b/tests/integration/targets/ec2_security_group/aliases @@ -3,4 +3,4 @@ slow cloud/aws -ec2_group_info +ec2_security_group_info diff --git a/tests/integration/targets/ec2_group/defaults/main.yml b/tests/integration/targets/ec2_security_group/defaults/main.yml similarity index 100% rename from tests/integration/targets/ec2_group/defaults/main.yml rename to tests/integration/targets/ec2_security_group/defaults/main.yml diff --git a/tests/integration/targets/ec2_group/meta/main.yml b/tests/integration/targets/ec2_security_group/meta/main.yml similarity index 100% rename from tests/integration/targets/ec2_group/meta/main.yml rename to tests/integration/targets/ec2_security_group/meta/main.yml diff --git a/tests/integration/targets/ec2_group/tasks/data_validation.yml b/tests/integration/targets/ec2_security_group/tasks/data_validation.yml similarity index 100% rename from tests/integration/targets/ec2_group/tasks/data_validation.yml rename to tests/integration/targets/ec2_security_group/tasks/data_validation.yml diff --git a/tests/integration/targets/ec2_group/tasks/diff_mode.yml b/tests/integration/targets/ec2_security_group/tasks/diff_mode.yml similarity index 100% rename from tests/integration/targets/ec2_group/tasks/diff_mode.yml rename to tests/integration/targets/ec2_security_group/tasks/diff_mode.yml diff --git a/tests/integration/targets/ec2_group/tasks/egress_tests.yml b/tests/integration/targets/ec2_security_group/tasks/egress_tests.yml similarity index 100% rename from tests/integration/targets/ec2_group/tasks/egress_tests.yml rename to tests/integration/targets/ec2_security_group/tasks/egress_tests.yml diff --git a/tests/integration/targets/ec2_group/tasks/group_info.yml b/tests/integration/targets/ec2_security_group/tasks/group_info.yml similarity index 100% rename from tests/integration/targets/ec2_group/tasks/group_info.yml rename to tests/integration/targets/ec2_security_group/tasks/group_info.yml diff --git a/tests/integration/targets/ec2_group/tasks/icmp_verbs.yml b/tests/integration/targets/ec2_security_group/tasks/icmp_verbs.yml similarity index 100% rename from tests/integration/targets/ec2_group/tasks/icmp_verbs.yml rename to tests/integration/targets/ec2_security_group/tasks/icmp_verbs.yml diff --git a/tests/integration/targets/ec2_group/tasks/ipv6_default_tests.yml b/tests/integration/targets/ec2_security_group/tasks/ipv6_default_tests.yml similarity index 100% rename from tests/integration/targets/ec2_group/tasks/ipv6_default_tests.yml rename to tests/integration/targets/ec2_security_group/tasks/ipv6_default_tests.yml diff --git a/tests/integration/targets/ec2_group/tasks/main.yml b/tests/integration/targets/ec2_security_group/tasks/main.yml similarity index 100% rename from tests/integration/targets/ec2_group/tasks/main.yml rename to tests/integration/targets/ec2_security_group/tasks/main.yml diff --git a/tests/integration/targets/ec2_group/tasks/multi_account.yml b/tests/integration/targets/ec2_security_group/tasks/multi_account.yml similarity index 100% rename from tests/integration/targets/ec2_group/tasks/multi_account.yml rename to tests/integration/targets/ec2_security_group/tasks/multi_account.yml diff --git a/tests/integration/targets/ec2_group/tasks/multi_nested_target.yml b/tests/integration/targets/ec2_security_group/tasks/multi_nested_target.yml similarity index 100% rename from tests/integration/targets/ec2_group/tasks/multi_nested_target.yml rename to tests/integration/targets/ec2_security_group/tasks/multi_nested_target.yml diff --git a/tests/integration/targets/ec2_group/tasks/numeric_protos.yml b/tests/integration/targets/ec2_security_group/tasks/numeric_protos.yml similarity index 100% rename from tests/integration/targets/ec2_group/tasks/numeric_protos.yml rename to tests/integration/targets/ec2_security_group/tasks/numeric_protos.yml diff --git a/tests/integration/targets/ec2_group/tasks/rule_group_create.yml b/tests/integration/targets/ec2_security_group/tasks/rule_group_create.yml similarity index 100% rename from tests/integration/targets/ec2_group/tasks/rule_group_create.yml rename to tests/integration/targets/ec2_security_group/tasks/rule_group_create.yml diff --git a/tests/unit/plugins/modules/test_ec2_group.py b/tests/unit/plugins/modules/test_ec2_security_group.py similarity index 96% rename from tests/unit/plugins/modules/test_ec2_group.py rename to tests/unit/plugins/modules/test_ec2_security_group.py index 9b3a14eaacf..f185873f972 100644 --- a/tests/unit/plugins/modules/test_ec2_group.py +++ b/tests/unit/plugins/modules/test_ec2_security_group.py @@ -2,7 +2,7 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type -from ansible_collections.amazon.aws.plugins.modules import ec2_group as group_module +from ansible_collections.amazon.aws.plugins.modules import ec2_security_group as group_module def test_from_permission():