Source code for airflow.providers.amazon.aws.sensors.eks
# 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.#"""Tracking the state of EKS Clusters and Nodegroups."""fromtypingimportOptionalfromairflow.providers.amazon.aws.hooks.eksimportClusterStates,EKSHook,NodegroupStatesfromairflow.sensors.baseimportBaseSensorOperator
[docs]classEKSClusterStateSensor(BaseSensorOperator):""" Check the state of an Amazon EKS Cluster until the state of the Cluster equals the target state. :param cluster_name: The name of the Cluster to watch. (templated) :type cluster_name: str :param target_state: Target state of the Cluster. (templated) :type target_state: ClusterStates :param region: Which AWS region the connection should use. (templated) If this is None or empty then the default boto3 behaviour is used. :type region: str :param aws_conn_id: The Airflow connection used for AWS credentials. (templated) If this is None or empty then the default boto3 behaviour is used. If running Airflow in a distributed manner and aws_conn_id is None or empty, then the default boto3 configuration would be used (and must be maintained on each worker node). :type aws_conn_id: str """
[docs]classEKSNodegroupStateSensor(BaseSensorOperator):""" Check the state of an Amazon EKS Nodegroup until the state of the Nodegroup equals the target state. :param cluster_name: The name of the Cluster which the Nodegroup is attached to. (templated) :type cluster_name: str :param nodegroup_name: The name of the Nodegroup to watch. (templated) :type nodegroup_name: str :param target_state: Target state of the Nodegroup. (templated) :type target_state: NodegroupStates :param region: Which AWS region the connection should use. (templated) If this is None or empty then the default boto3 behaviour is used. :type region: str :param aws_conn_id: The Airflow connection used for AWS credentials. (templated) If this is None or empty then the default boto3 behaviour is used. If running Airflow in a distributed manner and aws_conn_id is None or empty, then the default boto3 configuration would be used (and must be maintained on each worker node). :type aws_conn_id: str """