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 réponse
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
répondu il y a un an

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions