[ 
https://issues.apache.org/jira/browse/AIRFLOW-7068?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17100218#comment-17100218
 ] 

ASF GitHub Bot commented on AIRFLOW-7068:
-----------------------------------------

mustafagok commented on a change in pull request #7731:
URL: https://github.com/apache/airflow/pull/7731#discussion_r420367312



##########
File path: airflow/providers/amazon/aws/operators/ec2_start_instance.py
##########
@@ -0,0 +1,72 @@
+#
+# 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.
+#
+
+from typing import Optional
+
+from airflow.models import BaseOperator
+from airflow.providers.amazon.aws.hooks.ec2 import EC2Hook
+from airflow.utils.decorators import apply_defaults
+
+
+class EC2StartInstanceOperator(BaseOperator):
+    """
+    Start AWS EC2 instance using boto3.
+
+    :param instance_id: id of the AWS EC2 instance
+    :type instance_id: str
+    :param aws_conn_id: aws connection to use
+    :type aws_conn_id: str
+    :param region_name: (optional) aws region name associated with the client
+    :type region_name: Optional[str]
+    :param check_interval: time in seconds that the job should wait in
+        between each instance state checks until operation is completed
+    :type check_interval: float
+    """
+
+    template_fields = ("instance_id", "region_name")
+    ui_color = "#eeaa11"
+    ui_fgcolor = "#ffffff"

Review comment:
       maybe black could be better option for ec2 operator, but ec2 state 
sensor has darker background




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Create EC2 Hook, Operator and Sensor
> ------------------------------------
>
>                 Key: AIRFLOW-7068
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-7068
>             Project: Apache Airflow
>          Issue Type: Improvement
>          Components: aws
>    Affects Versions: 1.10.9
>            Reporter: Mustafa Gök
>            Assignee: Mustafa Gök
>            Priority: Minor
>
> * New hook to interact with AWS EC2 Service.
>  * New operator to manage AWS EC2 instance and to change instance state by 
> applying given operation using boto3.
>  * New sensor to check the state of the AWS EC2 instance until state of the 
> instance become equal to the target state.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to