airflow.providers.amazon.aws.triggers.redshift_cluster

Module Contents

Classes

RedshiftCreateClusterTrigger

Trigger for RedshiftCreateClusterOperator.

RedshiftPauseClusterTrigger

Trigger for RedshiftPauseClusterOperator.

RedshiftCreateClusterSnapshotTrigger

Trigger for RedshiftCreateClusterSnapshotOperator.

RedshiftResumeClusterTrigger

Trigger for RedshiftResumeClusterOperator.

RedshiftDeleteClusterTrigger

Trigger for RedshiftDeleteClusterOperator.

RedshiftClusterTrigger

RedshiftClusterTrigger is fired as deferred class with params to run the task in trigger worker.

class airflow.providers.amazon.aws.triggers.redshift_cluster.RedshiftCreateClusterTrigger(cluster_identifier, poll_interval=None, max_attempt=None, aws_conn_id='aws_default', waiter_delay=15, waiter_max_attempts=999999)[source]

Bases: airflow.providers.amazon.aws.triggers.base.AwsBaseWaiterTrigger

Trigger for RedshiftCreateClusterOperator.

The trigger will asynchronously poll the boto3 API and wait for the Redshift cluster to be in the available state.

Parameters
  • cluster_identifier (str) – A unique identifier for the cluster.

  • waiter_delay (int) – The amount of time in seconds to wait between attempts.

  • waiter_max_attempts (int) – The maximum number of attempts to be made.

  • aws_conn_id (str) – The Airflow connection used for AWS credentials.

hook()[source]

Override in subclasses to return the right hook.

class airflow.providers.amazon.aws.triggers.redshift_cluster.RedshiftPauseClusterTrigger(cluster_identifier, poll_interval=None, max_attempts=None, aws_conn_id='aws_default', waiter_delay=15, waiter_max_attempts=999999)[source]

Bases: airflow.providers.amazon.aws.triggers.base.AwsBaseWaiterTrigger

Trigger for RedshiftPauseClusterOperator.

The trigger will asynchronously poll the boto3 API and wait for the Redshift cluster to be in the paused state.

Parameters
  • cluster_identifier (str) – A unique identifier for the cluster.

  • waiter_delay (int) – The amount of time in seconds to wait between attempts.

  • waiter_max_attempts (int) – The maximum number of attempts to be made.

  • aws_conn_id (str) – The Airflow connection used for AWS credentials.

hook()[source]

Override in subclasses to return the right hook.

class airflow.providers.amazon.aws.triggers.redshift_cluster.RedshiftCreateClusterSnapshotTrigger(cluster_identifier, poll_interval=None, max_attempts=None, aws_conn_id='aws_default', waiter_delay=15, waiter_max_attempts=999999)[source]

Bases: airflow.providers.amazon.aws.triggers.base.AwsBaseWaiterTrigger

Trigger for RedshiftCreateClusterSnapshotOperator.

The trigger will asynchronously poll the boto3 API and wait for the Redshift cluster snapshot to be in the available state.

Parameters
  • cluster_identifier (str) – A unique identifier for the cluster.

  • waiter_delay (int) – The amount of time in seconds to wait between attempts.

  • waiter_max_attempts (int) – The maximum number of attempts to be made.

  • aws_conn_id (str) – The Airflow connection used for AWS credentials.

hook()[source]

Override in subclasses to return the right hook.

class airflow.providers.amazon.aws.triggers.redshift_cluster.RedshiftResumeClusterTrigger(cluster_identifier, poll_interval=None, max_attempts=None, aws_conn_id='aws_default', waiter_delay=15, waiter_max_attempts=999999)[source]

Bases: airflow.providers.amazon.aws.triggers.base.AwsBaseWaiterTrigger

Trigger for RedshiftResumeClusterOperator.

The trigger will asynchronously poll the boto3 API and wait for the Redshift cluster to be in the available state.

Parameters
  • cluster_identifier (str) – A unique identifier for the cluster.

  • waiter_delay (int) – The amount of time in seconds to wait between attempts.

  • waiter_max_attempts (int) – The maximum number of attempts to be made.

  • aws_conn_id (str) – The Airflow connection used for AWS credentials.

hook()[source]

Override in subclasses to return the right hook.

class airflow.providers.amazon.aws.triggers.redshift_cluster.RedshiftDeleteClusterTrigger(cluster_identifier, poll_interval=None, max_attempts=None, aws_conn_id='aws_default', waiter_delay=30, waiter_max_attempts=30)[source]

Bases: airflow.providers.amazon.aws.triggers.base.AwsBaseWaiterTrigger

Trigger for RedshiftDeleteClusterOperator.

Parameters
  • cluster_identifier (str) – A unique identifier for the cluster.

  • waiter_max_attempts (int) – The maximum number of attempts to be made.

  • aws_conn_id (str) – The Airflow connection used for AWS credentials.

  • waiter_delay (int) – The amount of time in seconds to wait between attempts.

hook()[source]

Override in subclasses to return the right hook.

class airflow.providers.amazon.aws.triggers.redshift_cluster.RedshiftClusterTrigger(aws_conn_id, cluster_identifier, target_status, poke_interval)[source]

Bases: airflow.triggers.base.BaseTrigger

RedshiftClusterTrigger is fired as deferred class with params to run the task in trigger worker.

Parameters
  • aws_conn_id (str) – Reference to AWS connection id for redshift

  • cluster_identifier (str) – unique identifier of a cluster

  • target_status (str) – Reference to the status which needs to be checked

  • poke_interval (float) – polling period in seconds to check for the status

serialize()[source]

Serializes RedshiftClusterTrigger arguments and classpath.

async run()[source]

Simple async function run until the cluster status match the target status.

Was this entry helpful?