AWS Lambda - Unable to connect to SQL Server RDS

可紊 提交于 2019-12-04 19:28:46

Added the following in each function in the serverless.template.

"Role": "arn:aws:iam::053984854873:role/1234-Dev",              
    "Policies": [ "AWSLambdaBasicExecutionRole", "AWSLambdaBasicExecutionRole-ABC1234","LambdaAccess-1234" ], 
    "VpcConfig" : {
        "SecurityGroupIds" : ["sg-4f2cbff1","sg-3584a444"],
        "SubnetIds" : ["subnet-f2520727","subnet-388b4ab2"]
    }

If the answer is the same as the referenced post, then there wasn't any sample code because it isn't a code issue. He upgraded the database engine version in RDS because the drivers that AWS Lambda uses wouldn't support connections to MSSQL 2008 R2, while his local machine had the necessary drivers.

Here is the AWS doc on upgrading RDS SQL Server Engine versions:

http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_UpgradeDBInstance.SQLServer.html

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!