Is there a version of "lambda_dnslookup" that I can include in my python lambda?

0

I have a python lambda function where I'm trying to use dns.resolver. I have versions of the function that work in windows and Linux, but it doesn't work in a lambda.
It seems like somehow the "import dns.resolver" is converted to "lambda_dnslookup". Here's the error: [ERROR] Runtime.ImportModuleError: Unable to import module 'lambda_dnslookup': No module named 'lambda_dnslookup' Traceback (most recent call last): Here's my imports: import boto3 import socket import csv import dns.resolver import requests import logging from splunklogger import SplunkLogger import time import subprocess import re import json from datetime import datetime from pprint import pprint

已提問 1 年前檢視次數 537 次
1 個回答
0

Hello, 


You typically receive this error when your Lambda environment can't find the specified library in the Python code. This is because Lambda isn't prepackaged with all Python libraries. The Lambda function depends only on standard libraries. To resolve this error, create a deployment package or Lambda layer that includes the libraries that you want to use in your Python code for Lambda.



Additional information can be found here. https://aws.amazon.com/premiumsupport/knowledge-center/lambda-import-module-error-python/?nc1=h_ls


I hope the information above helps you.

AWS
Junho_J
已回答 1 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南