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 Antwort
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
beantwortet vor einem Jahr

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen