airflow.providers.amazon.aws.operators.eks

This module contains Amazon EKS operators.

Module Contents

airflow.providers.amazon.aws.operators.eks.CHECK_INTERVAL_SECONDS = 15[source]
airflow.providers.amazon.aws.operators.eks.TIMEOUT_SECONDS[source]
airflow.providers.amazon.aws.operators.eks.DEFAULT_COMPUTE_TYPE = nodegroup[source]
airflow.providers.amazon.aws.operators.eks.DEFAULT_CONN_ID = aws_default[source]
airflow.providers.amazon.aws.operators.eks.DEFAULT_NAMESPACE_NAME = default[source]
airflow.providers.amazon.aws.operators.eks.DEFAULT_NODEGROUP_NAME_SUFFIX = -nodegroup[source]
airflow.providers.amazon.aws.operators.eks.DEFAULT_POD_NAME = pod[source]
class airflow.providers.amazon.aws.operators.eks.EKSCreateClusterOperator(cluster_name: str, cluster_role_arn: str, resources_vpc_config: Dict, nodegroup_name: Optional[str] = None, nodegroup_role_arn: Optional[str] = None, compute: Optional[str] = DEFAULT_COMPUTE_TYPE, aws_conn_id: str = DEFAULT_CONN_ID, region: Optional[str] = None, **kwargs)[source]

Bases: airflow.models.BaseOperator

Creates an Amazon EKS Cluster control plane.

Optionally, can also create the supporting compute architecture: If argument 'compute' is provided with a value of 'nodegroup', will also attempt to create an Amazon EKS Managed Nodegroup for the cluster. See EKSCreateNodegroupOperator documentation for requirements.

See also

For more information on how to use this operator, take a look at the guide: Create an Amazon EKS Cluster

Parameters
  • cluster_name (str) -- The unique name to give to your Amazon EKS Cluster. (templated)

  • cluster_role_arn (str) -- The Amazon Resource Name (ARN) of the IAM role that provides permissions for the Kubernetes control plane to make calls to AWS API operations on your behalf. (templated)

  • resources_vpc_config (Dict) -- The VPC configuration used by the cluster control plane. (templated)

  • compute (str) -- The type of compute architecture to generate along with the cluster. (templated) Defaults to 'nodegroup' to generate an EKS Managed Nodegroup.

  • aws_conn_id (str) -- 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).

  • region (str) -- Which AWS region the connection should use. (templated) If this is None or empty then the default boto3 behaviour is used.

If compute is assigned the value of nodegroup, the following are required:

Parameters
  • nodegroup_name (str) -- The unique name to give your EKS Managed Nodegroup. (templated)

  • nodegroup_role_arn (str) -- The Amazon Resource Name (ARN) of the IAM role to associate with the EKS Managed Nodegroup. (templated)

template_fields :Iterable[str] = ['cluster_name', 'cluster_role_arn', 'resources_vpc_config', 'nodegroup_name', 'nodegroup_role_arn', 'compute', 'aws_conn_id', 'region'][source]
execute(self, context)[source]
class airflow.providers.amazon.aws.operators.eks.EKSCreateNodegroupOperator(cluster_name: str, nodegroup_subnets: List[str], nodegroup_role_arn: str, nodegroup_name: Optional[str] = None, aws_conn_id: str = DEFAULT_CONN_ID, region: Optional[str] = None, **kwargs)[source]

Bases: airflow.models.BaseOperator

Creates am Amazon EKS Managed Nodegroup for an existing Amazon EKS Cluster.

See also

For more information on how to use this operator, take a look at the guide: Create an Amazon EKS Managed NodeGroup

Parameters
  • cluster_name (str) -- The name of the Amazon EKS Cluster to create the managed nodegroup in. (templated)

  • nodegroup_name (str) -- The unique name to give your managed nodegroup. (templated)

  • nodegroup_subnets (List[str]) -- The subnets to use for the Auto Scaling group that is created for the managed nodegroup. (templated)

  • nodegroup_role_arn (str) -- The Amazon Resource Name (ARN) of the IAM role to associate with the managed nodegroup. (templated)

  • aws_conn_id (str :param region: Which AWS region the connection should use. (templated) If this is None or empty then the default boto3 behaviour is used.) -- 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).

template_fields :Iterable[str] = ['cluster_name', 'nodegroup_subnets', 'nodegroup_role_arn', 'nodegroup_name', 'aws_conn_id', 'region'][source]
execute(self, context)[source]
class airflow.providers.amazon.aws.operators.eks.EKSDeleteClusterOperator(cluster_name: str, force_delete_compute: bool = False, aws_conn_id: str = DEFAULT_CONN_ID, region: Optional[str] = None, **kwargs)[source]

Bases: airflow.models.BaseOperator

Deletes the Amazon EKS Cluster control plane and all nodegroups attached to it.

See also

For more information on how to use this operator, take a look at the guide: Delete an Amazon EKS Cluster

Parameters
  • cluster_name (str) -- The name of the Amazon EKS Cluster to delete. (templated)

  • force_delete_compute (bool) -- If True, will delete any attached resources. (templated) Defaults to False.

  • aws_conn_id (str) -- 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).

  • region (str) -- Which AWS region the connection should use. (templated) If this is None or empty then the default boto3 behaviour is used.

template_fields :Iterable[str] = ['cluster_name', 'force_delete_compute', 'aws_conn_id', 'region'][source]
execute(self, context)[source]
class airflow.providers.amazon.aws.operators.eks.EKSDeleteNodegroupOperator(cluster_name: str, nodegroup_name: str, aws_conn_id: str = DEFAULT_CONN_ID, region: Optional[str] = None, **kwargs)[source]

Bases: airflow.models.BaseOperator

Deletes an Amazon EKS Nodegroup from an Amazon EKS Cluster.

See also

For more information on how to use this operator, take a look at the guide: Delete an Amazon EKS Managed Nodegroup

Parameters
  • cluster_name (str) -- The name of the Amazon EKS Cluster associated with your nodegroup. (templated)

  • nodegroup_name (str) -- The name of the nodegroup to delete. (templated)

  • aws_conn_id (str) -- 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).

  • region (str) -- Which AWS region the connection should use. (templated) If this is None or empty then the default boto3 behaviour is used.

template_fields :Iterable[str] = ['cluster_name', 'nodegroup_name', 'aws_conn_id', 'region'][source]
execute(self, context)[source]
class airflow.providers.amazon.aws.operators.eks.EKSPodOperator(cluster_name: str, in_cluster: bool = False, namespace: str = DEFAULT_NAMESPACE_NAME, pod_context: str = DEFAULT_CONTEXT_NAME, pod_name: str = DEFAULT_POD_NAME, pod_username: str = DEFAULT_POD_USERNAME, aws_conn_id: str = DEFAULT_CONN_ID, region: Optional[str] = None, **kwargs)[source]

Bases: airflow.providers.cncf.kubernetes.operators.kubernetes_pod.KubernetesPodOperator

Executes a task in a Kubernetes pod on the specified Amazon EKS Cluster.

See also

For more information on how to use this operator, take a look at the guide: Perform a Task on an Amazon EKS Cluster

Parameters
  • cluster_name (str) -- The name of the Amazon EKS Cluster to execute the task on. (templated)

  • cluster_role_arn (str) -- The Amazon Resource Name (ARN) of the IAM role that provides permissions for the Kubernetes control plane to make calls to AWS API operations on your behalf. (templated)

  • in_cluster (bool) -- If True, look for config inside the cluster; if False look for a local file path.

  • namespace (str) -- The namespace in which to execute the pod. (templated)

  • pod_context (str) -- The security context to use while executing the pod. (templated)

  • pod_name (str) -- The unique name to give the pod. (templated)

  • pod_username (str) -- The username to use while executing the pod. (templated)

  • aws_profile -- The named profile containing the credentials for the AWS CLI tool to use.

  • aws_profile -- str

  • region (str) -- Which AWS region the connection should use. (templated) If this is None or empty then the default boto3 behaviour is used.

  • aws_conn_id (str) -- 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).

template_fields :Iterable[str][source]
execute(self, context)[source]

Was this entry helpful?