094459 commented on a change in pull request #22093:
URL: https://github.com/apache/airflow/pull/22093#discussion_r822808735
##########
File path: docs/apache-airflow-providers-amazon/operators/ecs.rst
##########
@@ -46,6 +46,149 @@ Before using EcsOperator *cluster*, *task definition*, and
*container* need to b
:start-after: [START howto_operator_ecs]
:end-before: [END howto_operator_ecs]
+Using Operator
+--------------
+
+
+Launch Types
+--------------
+
+You can use this Operator to run ECS Tasks in ECS Clusters with launch types
of EC2, Fargate and EXTERNAL, using the "launch_type" parameter. Bear in mind
that the different launch types will require different parameters to be
supplied.
+
+```
+launch_type="EC2|Fargate|EXTERNAL"
+```
+
+*Example Operator for launch_type of EC2 and EXTERNAL*
+
+```
+ hello_world = EcsOperator(
+ task_id="hello_world",
+ dag=dag,
+ aws_conn_id="aws_default",
+ cluster="ecs-cluster-name",
+ task_definition="ecs-task-definition",
+ launch_type="EC2|EXTERNAL",
+ overrides={ "containerOverrides": [
+ {
+ "name": "hello-world-container",
+ "command" : [ "echo","hello world from Airflow" ],
+ }
+ ] },
+ tags={
+ "Customer": "X",
+ "Project": "Y",
+ "Application": "Z",
+ "Version": "0.0.1",
+ "Environment": "Development",
+ }
+ )
Review comment:
Ok, I did consider this but thought including the whole file was too
verbose - I just wanted to include just the specific lines for the sake of
clarity. What is the preferred way of doing this? I noticed the partials
folder, should I create the code in there instead?
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]