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개 답변
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
답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠