pankajastro commented on code in PR #30244:
URL: https://github.com/apache/airflow/pull/30244#discussion_r1210050231
##########
airflow/providers/amazon/aws/triggers/redshift_cluster.py:
##########
@@ -357,3 +357,78 @@ async def run(self):
)
else:
yield TriggerEvent({"status": "success", "message": "Cluster
resumed"})
+
+
+class RedshiftDeleteClusterTrigger(BaseTrigger):
+ """
+ Trigger for RedshiftDeleteClusterOperator
+
+ :param cluster_identifier: A unique identifier for the cluster.
+ :param max_attempts: The maximum number of attempts to be made.
+ :param aws_conn_id: The Airflow connection used for AWS credentials.
+ :param poll_interval: The amount of time in seconds to wait between
attempts.
+ """
+
+ def __init__(
+ self,
+ cluster_identifier: str,
+ max_attempts: int = 30,
+ aws_conn_id: str = "aws_default",
+ poll_interval: int = 30,
+ ):
+ super().__init__()
+ self.cluster_identifier = cluster_identifier
+ self.max_attempts = max_attempts
+ self.aws_conn_id = aws_conn_id
+ self.poll_interval = poll_interval
+
+ def serialize(self) -> tuple[str, dict[str, Any]]:
+ return (
+
"airflow.providers.amazon.aws.triggers.redshift_cluster.RedshiftDeleteClusterTrigger",
+ {
+ "cluster_identifier": self.cluster_identifier,
+ "max_attempts": self.max_attempts,
+ "aws_conn_id": self.aws_conn_id,
+ "poll_interval": self.poll_interval,
+ },
+ )
+
+ @cached_property
+ def hook(self):
+ return RedshiftHook(aws_conn_id=self.aws_conn_id)
Review Comment:
In main we have RedshiftAsyncHook in one trigger RedshiftClusterTrigger
which I'll clean once this PR will be merged
https://github.com/apache/airflow/blob/main/airflow/providers/amazon/aws/triggers/redshift_cluster.py
can you please point me to which trigger you are looking at? Also, we decided
to go with boto waiter approach and not the async hook for aws async operator
https://github.com/apache/airflow/pull/30032
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]