From e69097c574c69aa0501e2bca104b4814bb1b6077 Mon Sep 17 00:00:00 2001 From: Mark Chappell Date: Wed, 11 Aug 2021 14:16:25 +0200 Subject: [PATCH] aws_s3_bucket_info - Add a check for botocore>='1.18.11' when pulling bucket_ownership_controls --- aws_s3_bucket_info.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/aws_s3_bucket_info.py b/aws_s3_bucket_info.py index 06885dfcd13..f5b9c44f04c 100644 --- a/aws_s3_bucket_info.py +++ b/aws_s3_bucket_info.py @@ -78,7 +78,9 @@ type: bool default: False bucket_ownership_controls: - description: Retrive S3 ownership controls. + description: + - Retrive S3 ownership controls. + - Access to bucket ownership controls requires botocore>=1.18.11. type: bool default: False bucket_website: @@ -593,6 +595,9 @@ def main(): module.deprecate("The 'aws_s3_bucket_facts' module has been renamed to 'aws_s3_bucket_info', " "and the renamed one no longer returns ansible_facts", date='2021-12-01', collection_name='community.aws') + if module.params.get("bucket_ownership_controls"): + module.require_botocore_at_least('1.18.11', reason='to retreive bucket ownership controls') + # Get parameters name = module.params.get("name") name_filter = module.params.get("name_filter")