Skip to content
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

Implements AWS SNS notification support for webhook #15184

Merged

Conversation

ethemcemozkan
Copy link
Contributor

@ethemcemozkan ethemcemozkan commented May 14, 2024

SUMMARY

closes #15183.

Support for AWS SNS notifications. SNS is a widespread service that is used to integrate with other AWS services(EG lambdas). This support would unlock use cases like triggering lambda functions, especially when AWX is deployed on EKS.

Decisions:

  1. Data Structure
    I preferred using the same structure as Webhook for message body data because it contains all job details. For now, I directly linked to Webhook to avoid duplication, but I am open to suggestions.
  2. AWS authentication
    To support non-AWS native environments, I added configuration options for AWS secret key, ID, and session tokens. When entered, these values are supplied to the underlining boto3 SNS client. If not entered, it falls back to the default authentication chain to support the native AWS environment. Properly configured EKS pods are created with temporary credentials that the default authentication chain can pick automatically.
ISSUE TYPE
  • New or Enhanced Feature
COMPONENT NAME
  • API
  • UI
AWX VERSION
awx: 0.1.dev33966+g94be22a
ADDITIONAL INFORMATION

Implementation for #15183.


@ethemcemozkan ethemcemozkan marked this pull request as ready for review May 21, 2024 12:17
@ethemcemozkan ethemcemozkan changed the title 15183 WIP aws sns notification support 15183 aws sns notification support May 21, 2024
@TheRealHaoLiu
Copy link
Member

Wow @ethemcemozkan amazing PR! thanks for the contribution

Signed-off-by: Ethem Cem Ozkan <ethemcem.ozkan@gmail.com>
Signed-off-by: Ethem Cem Ozkan <ethemcem.ozkan@gmail.com>
Signed-off-by: Ethem Cem Ozkan <ethemcem.ozkan@gmail.com>
Signed-off-by: Ethem Cem Ozkan <ethemcem.ozkan@gmail.com>
@TheRealHaoLiu
Copy link
Member

CI failure due to recent ansible 2.17 release and podman 5 release. Rebasing the PR to pick up CI fixes

@ethemcemozkan
Copy link
Contributor Author

@TheRealHaoLiu Thanks for yourquick reply, let me know if you have additions or fixes I have to make for builds

Signed-off-by: Ethem Cem Ozkan <ethemcem.ozkan@gmail.com>
Signed-off-by: Ethem Cem Ozkan <ethemcem.ozkan@gmail.com>
@ethemcemozkan
Copy link
Contributor Author

@jbradberry and @TheRealHaoLiu thanks for the approvals, I can fix the SNS test case, but if you can help me with the api-schema and the RBAC test failures, that would be great.

@TheRealHaoLiu
Copy link
Member

push a commit up to fix UI lint error lets see if anything else fails

@TheRealHaoLiu
Copy link
Member

api-schema failure is expected since this PR does introduce a new notification type and it won't block the PR

@TheRealHaoLiu
Copy link
Member

btw before we merge this PR (once the CI runs green) can you squash the PR and provide a good commit message? it will make it prettier in our git history. Thanks~

@TheRealHaoLiu
Copy link
Member

cool the RBAC failure went away its just the failure in awx/main/tests/unit/notifications/test_awssns.py now

Signed-off-by: Ethem Cem Ozkan <ethemcem.ozkan@gmail.com>
@ethemcemozkan
Copy link
Contributor Author

@TheRealHaoLiu yeap my upstream merge took care of that, the latest commit should also take care of my test case issue. Could you approve latest CI jobs?

@TheRealHaoLiu TheRealHaoLiu enabled auto-merge (squash) June 2, 2024 02:28
@TheRealHaoLiu
Copy link
Member

Fantastic, thanks @ethemcemozkan, I enabled auto-merge once the CI pass it should be merged. Again thank you for this awesome feature contribution!

@TheRealHaoLiu
Copy link
Member

If you would like to share a short video demo of this feature we would be honored to inclue it on our YouTube channel and in our next AWX community meeting

@TheRealHaoLiu TheRealHaoLiu changed the title 15183 aws sns notification support Implements AWS SNS notification support for webhook Jun 2, 2024
@TheRealHaoLiu
Copy link
Member

Push up an additional commit to fix liniting failure

@TheRealHaoLiu TheRealHaoLiu merged commit 37ad690 into ansible:devel Jun 2, 2024
19 of 20 checks passed
@ethemcemozkan
Copy link
Contributor Author

@TheRealHaoLiu thanks for merging it. I would like to create a short video but can you send an example for me?

@TheRealHaoLiu
Copy link
Member

@ethemcemozkan check out our community YouTube channel on https://www.youtube.com/@ansible-awx

@ethemcemozkan ethemcemozkan deleted the 15183-aws-sns-notifications branch June 6, 2024 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for AWS SNS(Simple Notification Service) notifications
3 participants