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
回答済み 1年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ