pyodbc is included in zip but still giving error when trying to test the lambda function.
Installed pyodbc using pip3 and included the lib file while creating the lambda zip.
import logging
import rds_config
import pyodbc
# import requests
#rds settings
rds_host = rds_config.server
name = rds_config.username
password = rds_config.password
db_name = rds_config.database
logger = logging.getLogger()
logger.setLevel(logging.INFO)
try:
cnxn = pyodbc.connect('DRIVER={ODBC Driver 17 for SQL Server};SERVER='+rds_host+';DATABASE='+db_name+';UID='+name+';PWD='+ password);
except pyodbc.Error as e:
logger.error("ERROR: Unexpected error: Could not connect to mssql server instance.")
logger.error(e)
sys.exit()
Should be able to run the testing of aws lambda function.