-
Notifications
You must be signed in to change notification settings - Fork 14.6k
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
[AIRFLOW-6258] add CloudFormation operators to AWS providers #6824
[AIRFLOW-6258] add CloudFormation operators to AWS providers #6824
Conversation
@aviemzur can you please fix errors?
|
175ab03
to
42e864c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please move those operators to airflow.providers.amazon.aws.hooks/operators.cloud_formation.py
. Additionally we try to keep operators for a single service in a single file.
Interact with AWS CloudFormation. | ||
""" | ||
|
||
def __init__(self, region_name=None, *args, **kwargs): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it's worth to move region_name
to methods? Then user will be able to specify this parameter using operators.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was going by the example of other AWS hooks
airflow/contrib/hooks/emr_hook.py
airflow/contrib/hooks/aws_logs_hook.py
Should I still change this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@feluelle I think you are more AWS experienced, can you take a look? 😃
|
||
:param aws_conn_id: aws connection to uses | ||
:type aws_conn_id: str | ||
:param kwargs: Additional arguments to be passed to CloudFormation. For possible arguments see: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's not a good idea. Please use other name for the argument like params
or stack
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, will use params
instead.
aws_conn_id='aws_default', | ||
*args, **kwargs): | ||
# pylint: disable=no-member | ||
self.operator_arguments = inspect.getfullargspec(super().__init__.__wrapped__)[0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was trying to use kwargs
for configuration.
As you mentioned above I should change this to use param
instead, and will delete this code.
Sure, I can consolidate to one file. I was going by the example of emr where there are 3 separate files But have no problem to consolidate to one file. |
661c4b3
to
e0e6e99
Compare
Add 2 new operators: CloudFormationCreateStackOperator and CloudFormationDeleteStackOperator
5895b59
to
9924987
Compare
9924987
to
51d2028
Compare
Just a nice reminder to do this as well :) |
@aviemzur can you please add new operators to |
Sure, will move them |
cbe77b7
to
45e68c0
Compare
45e68c0
to
b92339b
Compare
@nuclearpinguin made the requested change.
Please advise |
Base operator for CloudFormation operations. | ||
|
||
:param params: parameters to be passed to CloudFormation. | ||
:type dict |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:type dict | |
:type param: Dict |
|
||
:param params: parameters to be passed to CloudFormation. For possible arguments see: | ||
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/cloudformation.html#CloudFormation.Client.create_stack | ||
:type dict |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:type dict | |
:type params: Dict |
|
||
:param params: parameters to be passed to CloudFormation. For possible arguments see: | ||
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/cloudformation.html#CloudFormation.Client.delete_stack | ||
:type dict |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:type dict | |
:type params: Dict |
That should solve the problems. |
Codecov Report
@@ Coverage Diff @@
## master #6824 +/- ##
=========================================
+ Coverage 84.85% 85.2% +0.35%
=========================================
Files 679 841 +162
Lines 38536 40424 +1888
=========================================
+ Hits 32698 34445 +1747
- Misses 5838 5979 +141
Continue to review full report at Codecov.
|
e8d9972
to
2af82f2
Compare
8b6a9c4
to
fcd35bc
Compare
fcd35bc
to
3dce509
Compare
@nuclearpinguin made the changes you requested: Changes after CR 3 |
""" | ||
This is the main method to run CloudFormation operation. | ||
""" | ||
raise NotImplementedError() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree with @nuclearpinguin
eb9e8c6
to
d81c4fc
Compare
d81c4fc
to
4147ffc
Compare
Co-Authored-By: Felix Uellendall <feluelle@users.noreply.github.com>
Co-Authored-By: Felix Uellendall <feluelle@users.noreply.github.com>
Co-Authored-By: Felix Uellendall <feluelle@users.noreply.github.com>
Co-Authored-By: Felix Uellendall <feluelle@users.noreply.github.com>
Change elif to if
@feluelle committed all suggestions you made + made the changes you requested and all tests are passing on Travis. |
@nuclearpinguin @feluelle is anything else required prior to merging? |
Good work @aviemzur 🎉 |
Make sure you have checked all steps below.
Jira
Description
Add 2 new operators:
CloudFormationCreateStackOperator
andCloudFormationDeleteStackOperator
https://issues.apache.org/jira/browse/AIRFLOW-6258
Tests
TestCloudFormationCreateStackOperator
andTestCloudFormationDeleteStackOperator
Commits
Documentation