airflow.providers.amazon.aws.operators.ec2

Module Contents

Classes

EC2StartInstanceOperator

Start AWS EC2 instance using boto3.

EC2StopInstanceOperator

Stop AWS EC2 instance using boto3.

class airflow.providers.amazon.aws.operators.ec2.EC2StartInstanceOperator(*, instance_id, aws_conn_id='aws_default', region_name=None, check_interval=15, **kwargs)[source]

Bases: airflow.models.BaseOperator

Start AWS EC2 instance using boto3.

Parameters
  • instance_id (str) – id of the AWS EC2 instance

  • aws_conn_id (str) – aws connection to use

  • region_name (Optional[str]) – (optional) aws region name associated with the client

  • check_interval (float) – time in seconds that the job should wait in between each instance state checks until operation is completed

template_fields :Sequence[str] = ['instance_id', 'region_name'][source]
ui_color = #eeaa11[source]
ui_fgcolor = #ffffff[source]
execute(self, context)[source]

This is the main method to derive when creating an operator. Context is the same dictionary used as when rendering jinja templates.

Refer to get_template_context for more context.

class airflow.providers.amazon.aws.operators.ec2.EC2StopInstanceOperator(*, instance_id, aws_conn_id='aws_default', region_name=None, check_interval=15, **kwargs)[source]

Bases: airflow.models.BaseOperator

Stop AWS EC2 instance using boto3.

Parameters
  • instance_id (str) – id of the AWS EC2 instance

  • aws_conn_id (str) – aws connection to use

  • region_name (Optional[str]) – (optional) aws region name associated with the client

  • check_interval (float) – time in seconds that the job should wait in between each instance state checks until operation is completed

template_fields :Sequence[str] = ['instance_id', 'region_name'][source]
ui_color = #eeaa11[source]
ui_fgcolor = #ffffff[source]
execute(self, context)[source]

This is the main method to derive when creating an operator. Context is the same dictionary used as when rendering jinja templates.

Refer to get_template_context for more context.

Was this entry helpful?