Working: Local -> Lambda -> SNS Not Working: Lambda -> Lambda -> SNS
When running my code locally, I am able to invoke an already deployed AWS Lambda function (PublishSNS)--basically a filtering to send messages through AWS SNS.
After deploying my local code (Chatreport) to AWS Lambda itself, I am unable to get the now-deployed-to-Lambda Chatreport code invoke PublishSNS.
It doesn't seem to be an IAM issue nor my environment variables. I've used both the InvocationType='RequestResponse' and 'Event'.
Is there something about Lambda-to-Lambda invocation that I am unaware of?
s3_client = boto3.client('s3')
lambda_client = boto3.client('lambda')
def _push_to_sns(self):
event_data = dict(
function=self.function,
phone=self.phone,
message=self.commentary
)
lambda_client.invoke(
FunctionName='lambda-publishsns',
InvocationType='RequestResponse',
Payload=json.dumps(event_data)
)
Ok, so this was a fairly simple solution in this case and it has more to do with Zappa (serverless, python) settings than anything else.
Zappa uploads with default Handler info which needs to be adjusted if invoking manually.