在我使用 boto3 和 arn 通过其他 lambda 调用它后,AWS Lambda s3 触发器停止工作
我有一个AWS lambda函数,当我在S3存储桶中上传HTML时,它正在触发,并且效果很好。 然后,我对代码进行了一些更新,以便我也可以使用Boto3的client.invoke(pyhton3)调用另一个lambda,但是一旦我使用boto3调用了另一个lambda,它就停止了为S3工作。 (当我用boto3调用它时,它仍然可以正常工作)。
def lambda_handler(event, context):
api_flag = False
if 'api_call' in event and event['api_call'] is True:
api_flag = True
data = event
else:
#code if its triggered by s3.
print("Received event: " + json.dumps(event, indent=2))
print("Received context: ", context)
if api_flag is True:
return{success:200}
我希望这两种方法都会触发它。
I have an aws lambda function which is being triggered when I upload a html in s3 bucket and it works fine.
Then I updated the code a little bit so I can invoke it by another lambda using boto3's client.invoke (pyhton3) as well but as soon as I invoked it by another lambda using boto3 it stops working for s3. (It still works fine when I invoke it with boto3).
def lambda_handler(event, context):
api_flag = False
if 'api_call' in event and event['api_call'] is True:
api_flag = True
data = event
else:
#code if its triggered by s3.
print("Received event: " + json.dumps(event, indent=2))
print("Received context: ", context)
if api_flag is True:
return{success:200}
I expected it to be triggered by both methods.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论