Jan Sila
Jan Sila

Reputation: 1593

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?

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?

I'd like the Lambdas to have Python3.6 runtime, otherwise, I'm using the latest moto library and its dependencies including boto3.

Upvotes: 1

Views: 2885

Answers (1)

Sinan Erdem
Sinan Erdem

Reputation: 1124

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.

Upvotes: 1

Related Questions