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 AWS Elastic Container Service, using the boto3 library

EcsTaskLogFetcher

Fetches Cloudwatch log events with specific interval as a thread

EcsProtocol

A structured Protocol for boto3.client('ecs'). This is used for type hints on

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: enum.Enum

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: enum.Enum

Contains the possible State values of an ECS Task Definition.

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

Bases: enum.Enum

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 AWS Elastic Container Service, using the boto3 library Hook attribute conn has all methods that listed in documentation

Additional arguments (such as aws_conn_id or region_name) may be specified and

are passed down to the underlying AwsBaseHook.

See also

AwsGenericHook

Parameters

aws_conn_id – The Airflow connection used for AWS credentials.

get_cluster_state(cluster_name)[source]
get_task_definition_state(task_definition)[source]
get_task_state(cluster, task)[source]
class airflow.providers.amazon.aws.hooks.ecs.EcsTaskLogFetcher(*, log_group, log_stream_name, fetch_interval, logger, aws_conn_id='aws_default', region_name=None)[source]

Bases: threading.Thread

Fetches Cloudwatch log events with specific interval as a thread and sends the log events to the info channel of the provided logger.

run()[source]

Method representing the thread’s activity.

You may override this method in a subclass. The standard run() method invokes the callable object passed to the object’s constructor as the target argument, if any, with sequential and keyword arguments taken from the args and kwargs arguments, respectively.

get_last_log_messages(number_messages)[source]
get_last_log_message()[source]
is_stopped()[source]
stop()[source]
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]

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

get_waiter(x)[source]

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

describe_tasks(cluster, tasks)[source]

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

stop_task(cluster, task, reason)[source]

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

describe_task_definition(taskDefinition)[source]

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

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

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

Was this entry helpful?