Moto mock lambda publishing SNS
Moto mock lambda publishing SNS
I'm trying to test locally my AWS code where lambda notifies another lambda by publishing to SNS and I subscribe an SQS service to the topic. But I'm getting error about security token - hence I think the mocked lambda does not have IAM permissions to publish to SNS. But how would I added to it? Is it not admin within local mocks?
admin
The code is as follows - https://gist.github.com/jansila/70ea0dad704f0cb7ad3d93af092fe454
So far I managed to make work only by invoking Lambda with InvocationType=RequestResponse and catching the return value directly from lambda. But could I do it as in production and receive it from SQS?
InvocationType=RequestResponse
SQS
I'd like the Lambdas to have Python3.6 runtime, otherwise, I'm using the latest moto library and its dependencies including boto3.
moto
boto3
1 Answer
1
Have a look at this issue: https://github.com/spulec/moto/issues/1793
Your issue is most probably about the version incompatibility between boto3 and moto. I installed the moto==1.3.5. That solved the problem for now.
Thanks for contributing an answer to Stack Overflow!
But avoid …
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
But avoid …
To learn more, see our tips on writing great answers.
Required, but never shown
Required, but never shown
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
Ok, i have a look at it soon! Thanks
– Jan Sila
Aug 31 at 15:13