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

How to use ses/sns from lambda #979

Open
baconsi opened this issue Oct 20, 2023 · 3 comments
Open

How to use ses/sns from lambda #979

baconsi opened this issue Oct 20, 2023 · 3 comments
Labels

Comments

@baconsi
Copy link

baconsi commented Oct 20, 2023

Question

I want to send to ses/sns via apprise from a lambda, the lambda has permission to send in its iam role but as apprise forces you to specify a access key and secret key i am doing the following
svc='ses://[email protected]' + os.environ.get('AWS_ACCESS_KEY_ID') + '/' + os.environ.get('AWS_SECRET_ACCESS_KEY') + '/eu-west-1/' + recip_email

This should use the keys from the lambda but i get an error Unauthorized - Invalid Access/Secret Key Combination

any advice on how to get this working with lambda?

@caronc
Copy link
Owner

caronc commented Oct 20, 2023

I'm traveling right now, so I can't help test it with you right now. I can research to see how possible it would be to leverage the iam role.

If you test the Apprise service using the CLI (take out the overhead of lambda for now), does it work then?

I could be extra characters getting in there?

@baconsi
Copy link
Author

baconsi commented Oct 20, 2023

I have printed out the keys and they look ok, just thought i would check to see if its been done before. one way could be to use boto3 send_email if keys dont exist in the url, was there a reason against using boto3? if not i can take a look to see if i can figure it out and use send_email rather than requests if not keys exist

@caronc
Copy link
Owner

caronc commented Oct 20, 2023

I have printed out the keys and they look ok, just thought i would check to see if its been done before. one way could be to use boto3 send_email if keys dont exist in the url, was there a reason against using boto3? if not i can take a look to see if i can figure it out and use send_email rather than requests if not keys exist

The boto library is great, but very full of code and features that Apprise simply doesn't use. Keeping to it's minimalistic nature is a route i want to continue to strive to. I'm pretty certain it will involve some effort to add the iam role, but not impossible. Amazon's libraries and APIs are well documented. I'm more concerned that the keys aren't working

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants