### Apache Airflow Provider(s)

amazon

### Versions of Apache Airflow Providers

_No response_

### Apache Airflow version

2.5.0

### Operating System

MacOS

### Deployment

Virtualenv installation

### Deployment details

_No response_

### What happened

Discussed in #28294

### What you think should happen instead

_No response_

### How to reproduce

_No response_

### Anything else

_No response_

### Are you willing to submit PR?

- [ ] Yes I am willing to submit a PR!

### Code of Conduct

- [X] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)

#
#
from __future__ import annotations
import logging
import time
from typing import Callable
from airflow.exceptions import AirflowException
log = logging.getLogger(__name__)
def waiter(
    get_state_callable: Callable,
    get_state_args: dict,
    parse_response: list,
    desired_state: set,
    failure_states: set,
    object_type: str,
    action: str,
    countdown: int = 25 * 60,
    check_interval_seconds: int = 60,
) -> None:
    """
    Will call get_state_callable until it reaches the desired_state or the failure_states.
    It will also time out if it waits longer than countdown seconds.
    :param get_state_callable: A callable to run until it returns True
    :param get_state_args: Arguments to pass to get_state_callable
    :param parse_response: Dictionary keys to extract state from response of get_state_callable
    :param desired_state: Wait until the getter returns this value