【以下的问题经过翻译处理】 [ENV]
触发 Lambda -> ap-northeast-2
SQS 队列 -> ap-northeast-1
爬虫 EC2 -> ap-northeast-1
[流水线]
触发 Lambda -> 发送消息 -> SQS 队列 -> 爬虫 EC2
[权限]
触发 Lambda -> 队列授予发送消息权限(trigger_lambda)
爬虫 EC2 -> 队列授予消费消息权限(crawler_cluster_worker)
[所有者]
所有 -> 根帐户
[触发 Lambda 中的 Python 代码]
sqs_client.send_message(
QueueUrl=CRAWLER_SQS_MESSAGE_QUEUE_URL,
MessageBody=json.dumps(sqs_message)
)
[触发 Lambda 的错误详情]
[ERROR] ClientError: An error occurred (AccessDenied) when calling the SendMessage operation: Access to the resource https://sqs.ap-northeast-1.amazonaws.com/ is denied.
Traceback (most recent call last):
File "/var/task/main.py", line 136, in lambda_handler
raise e
File "/var/task/main.py", line 116, in lambda_handler
sqs_client.send_message(
File "/var/task/botocore/client.py", line 530, in _api_call
return self._make_api_call(operation_name, kwargs)
File "/var/task/botocore/client.py", line 960, in _make_api_call
raise error_class(parsed_response, operation_name)
[问题]
触发 Lambda 失败,但发送 SQS 消息总是成功的。权限和区域都没有问题。判断这是暂时性错误。能告诉我暂时性错误可能的原因吗?