Skip to content

always push ECS task ARN to xcom in EcsRunTaskOperator #33703

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 24, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions airflow/providers/amazon/aws/operators/ecs.py
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,8 @@ def execute(self, context):
# start the task except if we reattached to an existing one just before.
self._start_task()

self.xcom_push(context, key="ecs_task_arn", value=self.arn)

if self.deferrable:
self.defer(
trigger=TaskDoneTrigger(
Expand Down
2 changes: 0 additions & 2 deletions tests/system/providers/amazon/aws/example_ecs_fargate.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,6 @@ def delete_cluster(cluster_name: str) -> None:
"assignPublicIp": "ENABLED",
},
},
# You must set `reattach=True` in order to get ecs_task_arn if you plan to use a Sensor.
reattach=True,
)
# [END howto_operator_ecs]

Expand Down