airflow.providers.amazon.aws.hooks.ecs

Module Contents

Classes

EcsClusterStates

Contains the possible State values of an ECS Cluster.

EcsTaskDefinitionStates

Contains the possible State values of an ECS Task Definition.

EcsTaskStates

Contains the possible State values of an ECS Task.

EcsHook

Interact with Amazon Elastic Container Service (ECS).

EcsProtocol

A structured Protocol for boto3.client('ecs').

Functions

should_retry(exception)

Check if exception is related to ECS resource quota (CPU, MEM).

should_retry_eni(exception)

Check if exception is related to ENI (Elastic Network Interfaces).

airflow.providers.amazon.aws.hooks.ecs.should_retry(exception)[source]

Check if exception is related to ECS resource quota (CPU, MEM).

airflow.providers.amazon.aws.hooks.ecs.should_retry_eni(exception)[source]

Check if exception is related to ENI (Elastic Network Interfaces).

class airflow.providers.amazon.aws.hooks.ecs.EcsClusterStates[source]

Bases: airflow.providers.amazon.aws.utils._StringCompareEnum

Contains the possible State values of an ECS Cluster.

ACTIVE = 'ACTIVE'[source]
PROVISIONING = 'PROVISIONING'[source]
DEPROVISIONING = 'DEPROVISIONING'[source]
FAILED = 'FAILED'[source]
INACTIVE = 'INACTIVE'[source]
class airflow.providers.amazon.aws.hooks.ecs.EcsTaskDefinitionStates[source]

Bases: airflow.providers.amazon.aws.utils._StringCompareEnum

Contains the possible State values of an ECS Task Definition.

ACTIVE = 'ACTIVE'[source]
INACTIVE = 'INACTIVE'[source]
DELETE_IN_PROGRESS = 'DELETE_IN_PROGRESS'[source]
class airflow.providers.amazon.aws.hooks.ecs.EcsTaskStates[source]

Bases: airflow.providers.amazon.aws.utils._StringCompareEnum

Contains the possible State values of an ECS Task.

PROVISIONING = 'PROVISIONING'[source]
PENDING = 'PENDING'[source]
ACTIVATING = 'ACTIVATING'[source]
RUNNING = 'RUNNING'[source]
DEACTIVATING = 'DEACTIVATING'[source]
STOPPING = 'STOPPING'[source]
DEPROVISIONING = 'DEPROVISIONING'[source]
STOPPED = 'STOPPED'[source]
NONE = 'NONE'[source]
class airflow.providers.amazon.aws.hooks.ecs.EcsHook(*args, **kwargs)[source]

Bases: airflow.providers.amazon.aws.hooks.base_aws.AwsGenericHook

Interact with Amazon Elastic Container Service (ECS).

Provide thin wrapper around boto3.client("ecs").

Additional arguments (such as aws_conn_id) may be specified and are passed down to the underlying AwsBaseHook.

get_cluster_state(cluster_name)[source]

Get ECS Cluster state.

Parameters

cluster_name (str) – ECS Cluster name or full cluster Amazon Resource Name (ARN) entry.

get_task_definition_state(task_definition)[source]

Get ECS Task Definition state.

Parameters

task_definition (str) – The family for the latest ACTIVE revision, family and revision ( family:revision ) for a specific revision in the family, or full Amazon Resource Name (ARN) of the task definition to describe.

get_task_state(cluster, task)[source]

Get ECS Task state.

Parameters
  • cluster – The short name or full Amazon Resource Name (ARN) of the cluster that hosts the task or tasks to describe.

  • task – Task ID or full ARN entry.

class airflow.providers.amazon.aws.hooks.ecs.EcsProtocol[source]

Bases: airflow.typing_compat.Protocol

A structured Protocol for boto3.client('ecs').

This is used for type hints on EcsOperator.client().

run_task(**kwargs)[source]

Run a task.

https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/ecs.html#ECS.Client.run_task

get_waiter(x)[source]

Get a waiter.

https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/ecs.html#ECS.Client.get_waiter

describe_tasks(cluster, tasks)[source]

Describe tasks.

https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/ecs.html#ECS.Client.describe_tasks

stop_task(cluster, task, reason)[source]

Stop a task.

https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/ecs.html#ECS.Client.stop_task

describe_task_definition(taskDefinition)[source]

Describe a task definition.

https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/ecs.html#ECS.Client.describe_task_definition

list_tasks(cluster, launchType, desiredStatus, family)[source]

List tasks.

https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/ecs.html#ECS.Client.list_tasks

Was this entry helpful?