mirror of
https://github.com/healthchecks/healthchecks.git
synced 2026-04-25 23:15:49 +03:00
[GH-ISSUE #309] Feature Request: Support Amazon Simple Notification Service #235
Labels
No labels
bug
bug
bug
feature
good-first-issue
new integration
pull-request
question
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/healthchecks#235
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @chiyiliao on GitHub (Dec 3, 2019).
Original GitHub issue: https://github.com/healthchecks/healthchecks/issues/309
Thank you for develop a great tool for monitor crontab.
Here I have a feature request.
Is it possible to support Amazon Simple Notification Service?
https://aws.amazon.com/sns
Thank you!
@cuu508 commented on GitHub (Dec 3, 2019):
Thanks for the suggestion!
I guess this could almost be achieved with the standard webhook integration, if not for the signatures in the Authorization header that AWS requires, right?
When setting up the integration, would the user be supplying ARN, access key, secret key and message body? And the task of the integration would be to construct a correctly signed request to AWS, and fire it off?
@chiyiliao commented on GitHub (Dec 4, 2019):
Thanks for your reply.
I'm not sure is it can be achieved with standard webhook integration.
I always sent SNS by official python library. I have no idea how to generate Authorization header for the request.
When using AWS boto3 library, just call below method outside AWS machine:
response = boto3.client('sns', aws_access_key_id=key_id, aws_secret_access_key=secret_key, aws_session_token=token).publish(TopicArn=arn, Subject=subject, Message=message)
or call below method in AWS EC2 machine, it will get credentials according to AWS mechanism automatically.
https://boto3.amazonaws.com/v1/documentation/api/latest/guide/configuration.html
response = boto3.client('sns').publish(TopicArn=arn, Subject=subject, Message=message)
@cuu508 commented on GitHub (Dec 4, 2019):
Yes, boto3 is definitely an option. AWS also has a code sample on how to do signing – this could be used to avoid introducing the boto3 dependency: https://docs.aws.amazon.com/code-samples/latest/catalog/python-signv4-v4-signing-get-post.py.html
When setting up the integration, would the user be supplying ARN, access key and secret key? Or are you thinking about self-hosted installations and installation-wide AWS credentials?
@chiyiliao commented on GitHub (Dec 5, 2019):
It sounds good if remove boto3 dependency.
Base on my experience, user should provide ARN, region, access key and secret key when the service hosted in IDC. But only need to provide ARN when the service hosted in AWS. It depends on where the service hosted.
It also could be work when user supply ARN, region, access key and secret key in AWS environment, but it will miss out on the benefits of AWS Role.
@cuu508 commented on GitHub (Dec 5, 2019):
Are you self-hosting Healthchecks? On a self-hosted installations, Healthchecks already supports Apprise integration, which in turn supports SNS notifications.
@chiyiliao commented on GitHub (Dec 5, 2019):
Yes, I'm trying self-hosting Healthchecks.
Got it, thank you very much.
@marier-nico commented on GitHub (Apr 26, 2020):
Hey, I came across this issue hoping to find a way to do this on the non self-hosted version of Healthchecks! Would it be possible to add an integration for this? As @cuu508 mentioned above, it's not possible to do with the standard webhook integration because of the signatures AWS requires, and I'm not currently looking to self-host Healthchecks. 😄
@cuu508 commented on GitHub (Apr 27, 2020):
Not sure about adding a SNS integration at this time. My two main concerns with it are:
Perhaps a solution here is to use AWS Lambda: you could write a lambda function that posts a message to a SNS topic. The Lambda function then can be called with a simple webhook. You would also have full control over how the the message payload is constructed.
@marier-nico commented on GitHub (Apr 27, 2020):
Ahh yeah that totally makes sense actually. Now that you mention that, I have to agree that it's probably for the best not to add an integration!
I really like the solution to use AWS Lambda though, thanks for pointing it out! I don't know why I didn't think of it myself, seems obvious in retrospect now 😅