-
Notifications
You must be signed in to change notification settings - Fork 16.3k
Add full support for AWS SSM Run Command in Airflow #52769
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
Add full support for AWS SSM Run Command in Airflow #52769
Conversation
|
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide (https://github.com/apache/airflow/blob/main/contributing-docs/README.rst)
|
providers/amazon/src/airflow/providers/amazon/aws/triggers/ssm.py
Outdated
Show resolved
Hide resolved
providers/amazon/src/airflow/providers/amazon/aws/operators/ssm.py
Outdated
Show resolved
Hide resolved
providers/amazon/src/airflow/providers/amazon/aws/triggers/ssm.py
Outdated
Show resolved
Hide resolved
providers/amazon/src/airflow/providers/amazon/aws/triggers/ssm.py
Outdated
Show resolved
Hide resolved
|
Hey @vincbeck, just a gentle reminder on this one — let me know if there's anything else you'd like me to adjust. |
Sorry I missed that! LGTM :) |
|
Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions. |
|
Hey @Shlomit-B , any context on how I can run this test? What resources do I need |
Hey, to run this test you’ll need:
Then pass the role ARN via the system test context variable ROLE_ARN |
|
Thanks @Shlomit-B, in case you're interested, we regularly run system tests on our testing infrastructure and you can see the status of the |
Summary
Adds full support for AWS Systems Manager (SSM) Run Command in Apache Airflow, including:
SsmRunCommandOperator — sends commands to resources via SSM
SsmRunCommandCompletedSensor — waits for command completion using list_command_invocations.
SsmRunCommandTrigger — enables deferrable execution
SsmCommandWaiter — internal waiter for command completion logic
Unit tests for each component: operator, sensor, trigger, and waiter
System test that exercises the full flow on a live EC2 instance
Also included
Sensor design choices and rationale
When implementing SsmRunCommandCompletedSensor, I considered several approaches for handling command status across multiple target resources:
This logic improves reliability and better aligns with common use cases for SSM Run Command in production environments.
Open question for reviewers
Would it make sense to make the sensor behavior configurable?
For example, by adding a parameter like fail_on_any_failure=True to let users choose whether to fail immediately or wait for all command invocations to complete before deciding.
Currently, the sensor always fails as soon as one resource reports failure.
This seems like the safer default, but I’m open to making it user-configurable if that would better serve broader use cases.
closes: #42619
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named
{pr_number}.significant.rstor{issue_number}.significant.rst, in airflow-core/newsfragments.