mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-07 08:54:01 -07:00
AWS WAF module custom waiter (#37026)
Consolidate waiters to a single file * Add waiter message with token ID * Add waiter Add waiter for WAF change tokens Working waiter for waf_condition module Add support for waiters to waf_rule * WAF data model refactor * Fix ref to self.client * Add custom waiters to aws_waf_web_acl * Allow add/remove rule tasks to operate in parallel, then wait for their change tokens to complete * Move waiter into run_func_with_change_token_backoff since it is generic to all WAF update operations * Wait for deletes on waf_web_acl * Remove always-wait * Remove waiter retry catch
This commit is contained in:
parent
534e9e142b
commit
1c7b9e66b4
5 changed files with 82 additions and 19 deletions
|
@ -207,7 +207,7 @@ def find_and_update_rule(client, module, rule_id):
|
|||
}
|
||||
if changed:
|
||||
try:
|
||||
run_func_with_change_token_backoff(client, module, update, client.update_rule)
|
||||
run_func_with_change_token_backoff(client, module, update, client.update_rule, wait=True)
|
||||
except (botocore.exceptions.ClientError, botocore.exceptions.BotoCoreError) as e:
|
||||
module.fail_json_aws(e, msg='Could not update rule conditions')
|
||||
|
||||
|
@ -282,7 +282,7 @@ def ensure_rule_absent(client, module):
|
|||
if rule_id:
|
||||
remove_rule_conditions(client, module, rule_id)
|
||||
try:
|
||||
return True, run_func_with_change_token_backoff(client, module, {'RuleId': rule_id}, client.delete_rule)
|
||||
return True, run_func_with_change_token_backoff(client, module, {'RuleId': rule_id}, client.delete_rule, wait=True)
|
||||
except (botocore.exceptions.ClientError, botocore.exceptions.BotoCoreError) as e:
|
||||
module.fail_json_aws(e, msg='Could not delete rule')
|
||||
return False, {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue