From dd8b18ec8f5d14ae566bb9b9f5701d1d919715b3 Mon Sep 17 00:00:00 2001 From: Mark Chappell Date: Tue, 28 Jun 2022 21:49:26 +0200 Subject: [PATCH] Rename s3 modules (#1271) Rename s3 modules SUMMARY In line with the naming guidelines, removes the aws_ prefix from aws_s3_bucket_info and aws_s3_cors ISSUE TYPE Feature Pull Request COMPONENT NAME plugins/modules/aws_s3_bucket_info.py plugins/modules/aws_s3_cors.py plugins/modules/s3_bucket_info.py plugins/modules/s3_cors.py ADDITIONAL INFORMATION Reviewed-by: Alina Buzachis --- README.md | 4 ++-- changelogs/fragments/1271-rename-s3.yml | 3 +++ ...munity.aws.acm_certificate_info_module.rst | 1 + docs/community.aws.acm_certificate_module.rst | 1 + ...> community.aws.s3_bucket_info_module.rst} | 19 ++++++++------- ...e.rst => community.aws.s3_cors_module.rst} | 21 ++++++++-------- meta/runtime.yml | 9 +++++-- ...ws_s3_bucket_info.py => s3_bucket_info.py} | 23 ++++++++++-------- .../modules/{aws_s3_cors.py => s3_cors.py} | 24 ++++++++++--------- .../targets/legacy_missing_tests/aliases | 2 +- .../aliases | 0 .../defaults/main.yml | 0 .../meta/main.yml | 0 .../tasks/basic.yml | 0 .../tasks/bucket_ownership_controls.yml | 0 .../tasks/main.yml | 0 16 files changed, 62 insertions(+), 45 deletions(-) create mode 100644 changelogs/fragments/1271-rename-s3.yml rename docs/{community.aws.aws_s3_bucket_info_module.rst => community.aws.s3_bucket_info_module.rst} (99%) rename docs/{community.aws.aws_s3_cors_module.rst => community.aws.s3_cors_module.rst} (97%) rename plugins/modules/{aws_s3_bucket_info.py => s3_bucket_info.py} (97%) rename plugins/modules/{aws_s3_cors.py => s3_cors.py} (90%) rename tests/integration/targets/{aws_s3_bucket_info => s3_bucket_info}/aliases (100%) rename tests/integration/targets/{aws_s3_bucket_info => s3_bucket_info}/defaults/main.yml (100%) rename tests/integration/targets/{aws_s3_bucket_info => s3_bucket_info}/meta/main.yml (100%) rename tests/integration/targets/{aws_s3_bucket_info => s3_bucket_info}/tasks/basic.yml (100%) rename tests/integration/targets/{aws_s3_bucket_info => s3_bucket_info}/tasks/bucket_ownership_controls.yml (100%) rename tests/integration/targets/{aws_s3_bucket_info => s3_bucket_info}/tasks/main.yml (100%) diff --git a/README.md b/README.md index 4f278ae4dfd..cd0fceabb2b 100644 --- a/README.md +++ b/README.md @@ -62,8 +62,6 @@ Name | Description [community.aws.aws_msk_cluster](https://github.com/ansible-collections/community.aws/blob/main/docs/community.aws.aws_msk_cluster_module.rst)|Manage Amazon MSK clusters [community.aws.aws_msk_config](https://github.com/ansible-collections/community.aws/blob/main/docs/community.aws.aws_msk_config_module.rst)|Manage Amazon MSK cluster configurations. [community.aws.aws_region_info](https://github.com/ansible-collections/community.aws/blob/main/docs/community.aws.aws_region_info_module.rst)|Gather information about AWS regions. -[community.aws.aws_s3_bucket_info](https://github.com/ansible-collections/community.aws/blob/main/docs/community.aws.aws_s3_bucket_info_module.rst)|lists S3 buckets in AWS -[community.aws.aws_s3_cors](https://github.com/ansible-collections/community.aws/blob/main/docs/community.aws.aws_s3_cors_module.rst)|Manage CORS for S3 buckets in AWS [community.aws.aws_secret](https://github.com/ansible-collections/community.aws/blob/main/docs/community.aws.aws_secret_module.rst)|Manage secrets stored in AWS Secrets Manager [community.aws.aws_sgw_info](https://github.com/ansible-collections/community.aws/blob/main/docs/community.aws.aws_sgw_info_module.rst)|Fetch AWS Storage Gateway information [community.aws.aws_ssm_parameter_store](https://github.com/ansible-collections/community.aws/blob/main/docs/community.aws.aws_ssm_parameter_store_module.rst)|Manage key-value pairs in AWS SSM parameter store @@ -202,7 +200,9 @@ Name | Description [community.aws.route53_health_check](https://github.com/ansible-collections/community.aws/blob/main/docs/community.aws.route53_health_check_module.rst)|Manage health-checks in Amazons Route53 DNS service [community.aws.route53_info](https://github.com/ansible-collections/community.aws/blob/main/docs/community.aws.route53_info_module.rst)|Retrieves route53 details using AWS methods [community.aws.route53_zone](https://github.com/ansible-collections/community.aws/blob/main/docs/community.aws.route53_zone_module.rst)|add or delete Route53 zones +[community.aws.s3_bucket_info](https://github.com/ansible-collections/community.aws/blob/main/docs/community.aws.s3_bucket_info_module.rst)|Lists S3 buckets in AWS [community.aws.s3_bucket_notification](https://github.com/ansible-collections/community.aws/blob/main/docs/community.aws.s3_bucket_notification_module.rst)|Creates, updates or deletes S3 Bucket notifications targeting Lambda functions, SNS or SQS. +[community.aws.s3_cors](https://github.com/ansible-collections/community.aws/blob/main/docs/community.aws.s3_cors_module.rst)|Manage CORS for S3 buckets in AWS [community.aws.s3_lifecycle](https://github.com/ansible-collections/community.aws/blob/main/docs/community.aws.s3_lifecycle_module.rst)|Manage S3 bucket lifecycle rules in AWS [community.aws.s3_logging](https://github.com/ansible-collections/community.aws/blob/main/docs/community.aws.s3_logging_module.rst)|Manage logging facility of an s3 bucket in AWS [community.aws.s3_metrics_configuration](https://github.com/ansible-collections/community.aws/blob/main/docs/community.aws.s3_metrics_configuration_module.rst)|Manage s3 bucket metrics configuration in AWS diff --git a/changelogs/fragments/1271-rename-s3.yml b/changelogs/fragments/1271-rename-s3.yml new file mode 100644 index 00000000000..3766a0ddf15 --- /dev/null +++ b/changelogs/fragments/1271-rename-s3.yml @@ -0,0 +1,3 @@ +minor_changes: +- aws_s3_bucket_info - the ``aws_s3_bucket_info`` module has been renamed to ``s3_bucket_info``, ``aws_s3_bucket_info`` remains as an alias (https://github.com/ansible-collections/community.aws/pull/1271). +- aws_s3_cors - the ``aws_s3_cors`` module has been renamed to ``s3_cors``, ``aws_s3_cors`` remains as an alias (https://github.com/ansible-collections/community.aws/pull/1271). diff --git a/docs/community.aws.acm_certificate_info_module.rst b/docs/community.aws.acm_certificate_info_module.rst index 3fc76548c3a..eec46ade6f1 100644 --- a/docs/community.aws.acm_certificate_info_module.rst +++ b/docs/community.aws.acm_certificate_info_module.rst @@ -19,6 +19,7 @@ Synopsis -------- - Retrieve information for ACM certificates. - Note that this will not return information about uploaded keys of size 4096 bits, due to a limitation of the ACM API. +- Prior to release 5.0.0 this module was called ``community.aws.aws_acm_info``. The usage did not change. diff --git a/docs/community.aws.acm_certificate_module.rst b/docs/community.aws.acm_certificate_module.rst index 0bdf0d3feeb..d366f3ab9a0 100644 --- a/docs/community.aws.acm_certificate_module.rst +++ b/docs/community.aws.acm_certificate_module.rst @@ -36,6 +36,7 @@ Synopsis - Note that this may not work properly with keys of size 4096 bits, due to a limitation of the ACM API. +- Prior to release 5.0.0 this module was called ``community.aws.aws_acm``. The usage did not change. diff --git a/docs/community.aws.aws_s3_bucket_info_module.rst b/docs/community.aws.s3_bucket_info_module.rst similarity index 99% rename from docs/community.aws.aws_s3_bucket_info_module.rst rename to docs/community.aws.s3_bucket_info_module.rst index 6fd9f7e2795..8c5d05d6242 100644 --- a/docs/community.aws.aws_s3_bucket_info_module.rst +++ b/docs/community.aws.s3_bucket_info_module.rst @@ -1,11 +1,11 @@ -.. _community.aws.aws_s3_bucket_info_module: +.. _community.aws.s3_bucket_info_module: -******************************** -community.aws.aws_s3_bucket_info -******************************** +**************************** +community.aws.s3_bucket_info +**************************** -**lists S3 buckets in AWS** +**Lists S3 buckets in AWS** Version added: 1.0.0 @@ -18,6 +18,7 @@ Version added: 1.0.0 Synopsis -------- - Lists S3 buckets and details about those buckets. +- Prior to release 5.0.0 this module was called ``community.aws.aws_s3_bucket_info``. The usage did not change. @@ -120,7 +121,7 @@ Parameters -
Retrieve requested S3 bucket detailed information
+
Retrieve requested S3 bucket detailed information.
Each bucket_X option executes one API call, hence many options being set to true will cause slower module execution.
You can limit buckets by using the name or name_filter option.
@@ -629,12 +630,12 @@ Examples # Note: Only AWS S3 is currently supported - # Lists all s3 buckets - - community.aws.aws_s3_bucket_info: + # Lists all S3 buckets + - community.aws.s3_bucket_info: register: result # Retrieve detailed bucket information - - community.aws.aws_s3_bucket_info: + - community.aws.s3_bucket_info: # Show only buckets with name matching name_filter: your.testing # Choose facts to retrieve diff --git a/docs/community.aws.aws_s3_cors_module.rst b/docs/community.aws.s3_cors_module.rst similarity index 97% rename from docs/community.aws.aws_s3_cors_module.rst rename to docs/community.aws.s3_cors_module.rst index f42f7e6d242..c2b3c342791 100644 --- a/docs/community.aws.aws_s3_cors_module.rst +++ b/docs/community.aws.s3_cors_module.rst @@ -1,9 +1,9 @@ -.. _community.aws.aws_s3_cors_module: +.. _community.aws.s3_cors_module: -************************* -community.aws.aws_s3_cors -************************* +********************* +community.aws.s3_cors +********************* **Manage CORS for S3 buckets in AWS** @@ -17,7 +17,8 @@ Version added: 1.0.0 Synopsis -------- -- Manage CORS for S3 buckets in AWS +- Manage CORS for S3 buckets in AWS. +- Prior to release 5.0.0 this module was called ``community.aws.aws_s3_cors``. The usage did not change. @@ -155,7 +156,7 @@ Parameters -
Name of the s3 bucket
+
Name of the S3 bucket.
@@ -203,7 +204,7 @@ Parameters -
Cors rules to put on the s3 bucket
+
Cors rules to put on the S3 bucket.
@@ -241,7 +242,7 @@ Parameters -
Create or remove cors on the s3 bucket
+
Create or remove cors on the S3 bucket.
@@ -285,7 +286,7 @@ Examples # Note: These examples do not set authentication details, see the AWS Guide for details. # Create a simple cors for s3 bucket - - community.aws.aws_s3_cors: + - community.aws.s3_cors: name: mys3bucket state: present rules: @@ -302,7 +303,7 @@ Examples max_age_seconds: 30000 # Remove cors for s3 bucket - - community.aws.aws_s3_cors: + - community.aws.s3_cors: name: mys3bucket state: absent diff --git a/meta/runtime.yml b/meta/runtime.yml index 0a4afb0b219..51818c50b7c 100644 --- a/meta/runtime.yml +++ b/meta/runtime.yml @@ -182,6 +182,8 @@ action_groups: - route53_info - route53_zone - s3_bucket_notification + - s3_bucket_info + - s3_cors - s3_lifecycle - s3_logging - s3_metrics_configuration @@ -218,9 +220,12 @@ plugin_routing: aws_eks_cluster: # Deprecation for this alias should not *start* prior to 2024-09-01 redirect: community.aws.eks_cluster - aws_ses_identity_policy: + aws_s3_bucket_info: # Deprecation for this alias should not *start* prior to 2024-09-01 - redirect: community.aws.ses_identity_policy + redirect: community.aws.s3_bucket_info + aws_s3_cors: + # Deprecation for this alias should not *start* prior to 2024-09-01 + redirect: community.aws.s3_cors aws_ses_rule_set: # Deprecation for this alias should not *start* prior to 2024-09-01 redirect: community.aws.ses_rule_set diff --git a/plugins/modules/aws_s3_bucket_info.py b/plugins/modules/s3_bucket_info.py similarity index 97% rename from plugins/modules/aws_s3_bucket_info.py rename to plugins/modules/s3_bucket_info.py index 03da910549a..d164fde5d16 100644 --- a/plugins/modules/aws_s3_bucket_info.py +++ b/plugins/modules/s3_bucket_info.py @@ -10,12 +10,15 @@ DOCUMENTATION = ''' --- -module: aws_s3_bucket_info +module: s3_bucket_info version_added: 1.0.0 -author: "Gerben Geijteman (@hyperized)" -short_description: lists S3 buckets in AWS +author: + - "Gerben Geijteman (@hyperized)" +short_description: Lists S3 buckets in AWS description: - - Lists S3 buckets and details about those buckets. + - Lists S3 buckets and details about those buckets. + - Prior to release 5.0.0 this module was called C(community.aws.aws_s3_bucket_info). + The usage did not change. options: name: description: @@ -31,7 +34,7 @@ version_added: 1.4.0 bucket_facts: description: - - Retrieve requested S3 bucket detailed information + - Retrieve requested S3 bucket detailed information. - Each bucket_X option executes one API call, hence many options being set to C(true) will cause slower module execution. - You can limit buckets by using the I(name) or I(name_filter) option. suboptions: @@ -111,8 +114,8 @@ default: False version_added: 1.4.0 extends_documentation_fragment: -- amazon.aws.aws -- amazon.aws.ec2 + - amazon.aws.aws + - amazon.aws.ec2 ''' EXAMPLES = ''' @@ -120,12 +123,12 @@ # Note: Only AWS S3 is currently supported -# Lists all s3 buckets -- community.aws.aws_s3_bucket_info: +# Lists all S3 buckets +- community.aws.s3_bucket_info: register: result # Retrieve detailed bucket information -- community.aws.aws_s3_bucket_info: +- community.aws.s3_bucket_info: # Show only buckets with name matching name_filter: your.testing # Choose facts to retrieve diff --git a/plugins/modules/aws_s3_cors.py b/plugins/modules/s3_cors.py similarity index 90% rename from plugins/modules/aws_s3_cors.py rename to plugins/modules/s3_cors.py index 58e33cf1104..5500fecab64 100644 --- a/plugins/modules/aws_s3_cors.py +++ b/plugins/modules/s3_cors.py @@ -9,40 +9,42 @@ DOCUMENTATION = r''' --- -module: aws_s3_cors +module: s3_cors version_added: 1.0.0 short_description: Manage CORS for S3 buckets in AWS description: - - Manage CORS for S3 buckets in AWS -author: "Oyvind Saltvik (@fivethreeo)" + - Manage CORS for S3 buckets in AWS. + - Prior to release 5.0.0 this module was called C(community.aws.aws_s3_cors). + The usage did not change. +author: + - "Oyvind Saltvik (@fivethreeo)" options: name: description: - - Name of the s3 bucket + - Name of the S3 bucket. required: true type: str rules: description: - - Cors rules to put on the s3 bucket + - Cors rules to put on the S3 bucket. type: list elements: dict state: description: - - Create or remove cors on the s3 bucket + - Create or remove cors on the S3 bucket. required: true choices: [ 'present', 'absent' ] type: str 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. # Create a simple cors for s3 bucket -- community.aws.aws_s3_cors: +- community.aws.s3_cors: name: mys3bucket state: present rules: @@ -59,7 +61,7 @@ max_age_seconds: 30000 # Remove cors for s3 bucket -- community.aws.aws_s3_cors: +- community.aws.s3_cors: name: mys3bucket state: absent ''' diff --git a/tests/integration/targets/legacy_missing_tests/aliases b/tests/integration/targets/legacy_missing_tests/aliases index 7cd81fbc77a..9c04811ee54 100644 --- a/tests/integration/targets/legacy_missing_tests/aliases +++ b/tests/integration/targets/legacy_missing_tests/aliases @@ -10,7 +10,6 @@ aws_direct_connect_connection aws_direct_connect_gateway aws_direct_connect_link_aggregation_group aws_direct_connect_virtual_interface -aws_s3_cors aws_sgw_info cloudfront_info cloudfront_invalidation @@ -33,4 +32,5 @@ lambda_event rds_instance_snapshot rds_snapshot_info redshift_cross_region_snapshots +s3_cors s3_website diff --git a/tests/integration/targets/aws_s3_bucket_info/aliases b/tests/integration/targets/s3_bucket_info/aliases similarity index 100% rename from tests/integration/targets/aws_s3_bucket_info/aliases rename to tests/integration/targets/s3_bucket_info/aliases diff --git a/tests/integration/targets/aws_s3_bucket_info/defaults/main.yml b/tests/integration/targets/s3_bucket_info/defaults/main.yml similarity index 100% rename from tests/integration/targets/aws_s3_bucket_info/defaults/main.yml rename to tests/integration/targets/s3_bucket_info/defaults/main.yml diff --git a/tests/integration/targets/aws_s3_bucket_info/meta/main.yml b/tests/integration/targets/s3_bucket_info/meta/main.yml similarity index 100% rename from tests/integration/targets/aws_s3_bucket_info/meta/main.yml rename to tests/integration/targets/s3_bucket_info/meta/main.yml diff --git a/tests/integration/targets/aws_s3_bucket_info/tasks/basic.yml b/tests/integration/targets/s3_bucket_info/tasks/basic.yml similarity index 100% rename from tests/integration/targets/aws_s3_bucket_info/tasks/basic.yml rename to tests/integration/targets/s3_bucket_info/tasks/basic.yml diff --git a/tests/integration/targets/aws_s3_bucket_info/tasks/bucket_ownership_controls.yml b/tests/integration/targets/s3_bucket_info/tasks/bucket_ownership_controls.yml similarity index 100% rename from tests/integration/targets/aws_s3_bucket_info/tasks/bucket_ownership_controls.yml rename to tests/integration/targets/s3_bucket_info/tasks/bucket_ownership_controls.yml diff --git a/tests/integration/targets/aws_s3_bucket_info/tasks/main.yml b/tests/integration/targets/s3_bucket_info/tasks/main.yml similarity index 100% rename from tests/integration/targets/aws_s3_bucket_info/tasks/main.yml rename to tests/integration/targets/s3_bucket_info/tasks/main.yml