providers/amazon/docs/operators/redshift/redshift_cluster.rst
.. Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
.. http://www.apache.org/licenses/LICENSE-2.0
.. Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Amazon Redshift <https://aws.amazon.com/redshift/>__ manages all the work of setting up, operating, and scaling a data warehouse:
provisioning capacity, monitoring and backing up the cluster, and applying patches and upgrades to
the Amazon Redshift engine. You can focus on using your data to acquire new insights for your
business and customers.
.. include:: ../../_partials/prerequisite_tasks.rst
.. include:: ../../_partials/generic_parameters.rst
.. _howto/operator:RedshiftCreateClusterOperator:
To create an Amazon Redshift Cluster with the specified parameters you can use
:class:~airflow.providers.amazon.aws.operators.redshift_cluster.RedshiftCreateClusterOperator.
.. exampleinclude:: /../../amazon/tests/system/amazon/aws/example_redshift.py :language: python :dedent: 4 :start-after: [START howto_operator_redshift_cluster] :end-before: [END howto_operator_redshift_cluster]
.. _howto/operator:RedshiftResumeClusterOperator:
To resume a 'paused' Amazon Redshift cluster you can use
:class:RedshiftResumeClusterOperator <airflow.providers.amazon.aws.operators.redshift_cluster>
You can also run this operator in deferrable mode by setting deferrable param to True.
This will ensure that the task is deferred from the Airflow worker slot and polling for the task status happens on the trigger.
.. exampleinclude:: /../../amazon/tests/system/amazon/aws/example_redshift.py :language: python :dedent: 4 :start-after: [START howto_operator_redshift_resume_cluster] :end-before: [END howto_operator_redshift_resume_cluster]
.. _howto/operator:RedshiftPauseClusterOperator:
To pause an available Amazon Redshift cluster you can use
:class:RedshiftPauseClusterOperator <airflow.providers.amazon.aws.operators.redshift_cluster>.
You can also run this operator in deferrable mode by setting deferrable param to True
.. exampleinclude:: /../../amazon/tests/system/amazon/aws/example_redshift.py :language: python :dedent: 4 :start-after: [START howto_operator_redshift_pause_cluster] :end-before: [END howto_operator_redshift_pause_cluster]
.. _howto/operator:RedshiftCreateClusterSnapshotOperator:
To create Amazon Redshift cluster snapshot you can use
:class:RedshiftCreateClusterSnapshotOperator <airflow.providers.amazon.aws.operators.redshift_cluster>
.. exampleinclude:: /../../amazon/tests/system/amazon/aws/example_redshift.py :language: python :dedent: 4 :start-after: [START howto_operator_redshift_create_cluster_snapshot] :end-before: [END howto_operator_redshift_create_cluster_snapshot]
.. _howto/operator:RedshiftDeleteClusterSnapshotOperator:
To delete Amazon Redshift cluster snapshot you can use
:class:RedshiftDeleteClusterSnapshotOperator <airflow.providers.amazon.aws.operators.redshift_cluster>
.. exampleinclude:: /../../amazon/tests/system/amazon/aws/example_redshift.py :language: python :dedent: 4 :start-after: [START howto_operator_redshift_delete_cluster_snapshot] :end-before: [END howto_operator_redshift_delete_cluster_snapshot]
.. _howto/operator:RedshiftDeleteClusterOperator:
To delete an Amazon Redshift cluster you can use
:class:RedshiftDeleteClusterOperator <airflow.providers.amazon.aws.operators.redshift_cluster>.
You can also run this operator in deferrable mode by setting deferrable param to True
.. exampleinclude:: /../../amazon/tests/system/amazon/aws/example_redshift.py :language: python :dedent: 4 :start-after: [START howto_operator_redshift_delete_cluster] :end-before: [END howto_operator_redshift_delete_cluster]
.. _howto/sensor:RedshiftClusterSensor:
To check the state of an Amazon Redshift Cluster until it reaches the target state or another terminal
state you can use :class:~airflow.providers.amazon.aws.sensors.redshift_cluster.RedshiftClusterSensor.
.. exampleinclude:: /../../amazon/tests/system/amazon/aws/example_redshift.py :language: python :dedent: 4 :start-after: [START howto_sensor_redshift_cluster] :end-before: [END howto_sensor_redshift_cluster]
AWS boto3 library documentation for Amazon Redshift <https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/redshift.html>__