From c2663f3f62aea179c22e0408785d82d48a5b911c Mon Sep 17 00:00:00 2001 From: Alina Buzachis Date: Fri, 25 Mar 2022 13:58:38 +0100 Subject: [PATCH] Add version_added and add paginator Signed-off-by: Alina Buzachis --- plugins/modules/rds_subnet_group.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/plugins/modules/rds_subnet_group.py b/plugins/modules/rds_subnet_group.py index 577b62d946a..e549f07c54f 100644 --- a/plugins/modules/rds_subnet_group.py +++ b/plugins/modules/rds_subnet_group.py @@ -139,22 +139,26 @@ description: Contains Availability Zone information. returned: I(state=present) type: dict + version_added: 3.2.0 sample: name: "eu-north-1b" subnet_identifier: description: The identifier of the subnet. returned: I(state=present) type: str + version_added: 3.2.0 sample: "subnet-08c94870f4480797e" subnet_outpost: description: This value specifies the Outpost. returned: I(state=present) type: dict + version_added: 3.2.0 sample: {} subnet_status: description: The status of the subnet. returned: I(state=present) type: str + version_added: 3.2.0 sample: "Active" status: description: The status of the DB subnet group (maintained for backward compatibility) @@ -175,6 +179,7 @@ description: The tags associated with the subnet group returned: I(state=present) type: dict + version_added: 3.2.0 sample: tag1: Tag1 tag2: Tag2 @@ -215,12 +220,18 @@ def create_result(changed, subnet_group=None): ) +@AWSRetry.jittered_backoff() +def _describe_db_subnet_groups_with_backoff(client, **kwargs): + paginator = client.get_paginator('describe_db_subnet_groups') + return paginator.paginate(**kwargs).build_full_result() + + def get_subnet_group(client, module): params = dict() params['DBSubnetGroupName'] = module.params.get('name').lower() try: - _result = client.describe_db_subnet_groups(aws_retry=True, **params) + _result = _describe_db_subnet_groups_with_backoff(client, **params) except is_boto3_error_code('DBSubnetGroupNotFoundFault'): return None except (botocore.exceptions.ClientError, botocore.exceptions.BotoCoreError) as e: # pylint: disable=duplicate-except @@ -234,7 +245,7 @@ def get_subnet_group(client, module): def create_subnet_list(subnets): - ''' + r''' Construct a list of subnet ids from a list of subnets dicts returned by boto. Parameters: subnets (list): A list of subnets definitions.