<bdo id='HkEpk'></bdo><ul id='HkEpk'></ul>
  • <i id='HkEpk'><tr id='HkEpk'><dt id='HkEpk'><q id='HkEpk'><span id='HkEpk'><b id='HkEpk'><form id='HkEpk'><ins id='HkEpk'></ins><ul id='HkEpk'></ul><sub id='HkEpk'></sub></form><legend id='HkEpk'></legend><bdo id='HkEpk'><pre id='HkEpk'><center id='HkEpk'></center></pre></bdo></b><th id='HkEpk'></th></span></q></dt></tr></i><div id='HkEpk'><tfoot id='HkEpk'></tfoot><dl id='HkEpk'><fieldset id='HkEpk'></fieldset></dl></div>

    1. <small id='HkEpk'></small><noframes id='HkEpk'>

    2. <legend id='HkEpk'><style id='HkEpk'><dir id='HkEpk'><q id='HkEpk'></q></dir></style></legend>

    3. <tfoot id='HkEpk'></tfoot>

        AWS Lambda - 无法连接到 VPC 中的 SQL Server RDS

        AWS Lambda - Unable to connect to SQL Server RDS in VPC(AWS Lambda - 无法连接到 VPC 中的 SQL Server RDS)
        • <small id='UJWeh'></small><noframes id='UJWeh'>

              <i id='UJWeh'><tr id='UJWeh'><dt id='UJWeh'><q id='UJWeh'><span id='UJWeh'><b id='UJWeh'><form id='UJWeh'><ins id='UJWeh'></ins><ul id='UJWeh'></ul><sub id='UJWeh'></sub></form><legend id='UJWeh'></legend><bdo id='UJWeh'><pre id='UJWeh'><center id='UJWeh'></center></pre></bdo></b><th id='UJWeh'></th></span></q></dt></tr></i><div id='UJWeh'><tfoot id='UJWeh'></tfoot><dl id='UJWeh'><fieldset id='UJWeh'></fieldset></dl></div>
                <tbody id='UJWeh'></tbody>
              <legend id='UJWeh'><style id='UJWeh'><dir id='UJWeh'><q id='UJWeh'></q></dir></style></legend>
            1. <tfoot id='UJWeh'></tfoot>
                <bdo id='UJWeh'></bdo><ul id='UJWeh'></ul>

                1. 本文介绍了AWS Lambda - 无法连接到 VPC 中的 SQL Server RDS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在尝试从 VPC 中的 AWS Lambda 连接到我的 SQL Server RDS 实例(使用 .net core).

                  I am trying to connect to my SQL Server RDS instance from AWS Lambda in my VPC (using .net core).

                  当我尝试运行 Lambda 函数时,它返回:

                  When I attempt to run the Lambda function, it returns:

                  "errorType": "SqlException", "errorMessage": "Connection Timeout Expired.在登录后阶段超时时间已过.连接可能在等待服务器完成登录过程并响应时超时;或者它可能在尝试创建多个活动连接时超时.尝试连接到此服务器所花费的持续时间是 - [登录前]初始化=781;握手=1957;[登录]初始化=40;身份验证=122;[登录后] complete=12219;",

                  "errorType": "SqlException", "errorMessage": "Connection Timeout Expired. The timeout period elapsed during the post-login phase. The connection could have timed out while waiting for server to complete the login process and respond; Or it could have timed out while attempting to create multiple active connections. The duration spent while attempting to connect to this server was - [Pre-Login] initialization=781; handshake=1957; [Login] initialization=40; authentication=122; [Post-Login] complete=12219;",

                  我已经配置了以下内容:

                  I have configured the following:

                  • RDS 实例和 Lambda 都在同一个 VPC 中
                  • RDS 实例和 Lambda 都在同一个可用区和子网中
                  • Lambda 位于自己的安全组中
                  • RDS 实例安全组已为 Lambda SG 授予端口 1433 的权限
                  • Lambda IAM 角色拥有 AWSLambdaFullAccess 和 AWSLambdaVPCAccessExecutionRole 的权限
                  • MSSQL 连接字符串(端点、用户 ID、密码等)在同一 VPC/AZ/子网中的 EC2 实例中工作.

                  连接字符串看起来像这样(使用 Dapper 作为我的 ORM)

                  The connection string looks like this (using Dapper as my ORM)

                  string dbconnstr = @"server=vpc100-db.xyz.us-west-1.rds.amazonaws.com;database=dbMyDb;user id=sa;password=mypwd;";
                  

                  知道我错过了什么吗?

                  推荐答案

                  已解决.数据库引擎版本是问题.

                  Solved. DB engine version was the issue.

                  事实证明,这不是 Lambda 或 VPC 和 RDS 的权限问题.无法从 Lambda(通过 c# .net core)连接到 RDS 是数据库版本!我正在连接到一个 RDS MS SQL 2008 R2,它使用本地代码而不是 Lambda.当我将 RDS 目标数据库更改为 MS SQL 2016 时,它起作用了!

                  It turns out it wasn't a permission problem with Lambda or the VPC and RDS. The inability to connect from Lambda (via c# .net core) to the RDS was the database version! I was connecting to a RDS MS SQL 2008 R2 which worked from local code but not from Lambda. When I changed the RDS target db to MS SQL 2016 it worked!

                  这篇关于AWS Lambda - 无法连接到 VPC 中的 SQL Server RDS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  SQL Server add auto increment primary key to existing table(SQL Server 向现有表添加自动增量主键)
                  Altering a column: null to not null(改变列:null 到 not null)
                  Adding an identity to an existing column(向现有列添加标识)
                  How to write UPDATE SQL with Table alias in SQL Server 2008?(如何在 SQL Server 2008 中使用表别名编写 UPDATE SQL?)
                  Why can#39;t I use alias in a count(*) quot;columnquot; and reference it in a having clause?(为什么我不能在计数(*)“列中使用别名?并在具有条款中引用它?)
                  SQL Server 2005 quot;publicquot; database role doesn#39;t seem to apply?(SQL Server 2005“公共数据库角色似乎不适用?)
                    <tbody id='aXRvc'></tbody>
                          <i id='aXRvc'><tr id='aXRvc'><dt id='aXRvc'><q id='aXRvc'><span id='aXRvc'><b id='aXRvc'><form id='aXRvc'><ins id='aXRvc'></ins><ul id='aXRvc'></ul><sub id='aXRvc'></sub></form><legend id='aXRvc'></legend><bdo id='aXRvc'><pre id='aXRvc'><center id='aXRvc'></center></pre></bdo></b><th id='aXRvc'></th></span></q></dt></tr></i><div id='aXRvc'><tfoot id='aXRvc'></tfoot><dl id='aXRvc'><fieldset id='aXRvc'></fieldset></dl></div>
                          <tfoot id='aXRvc'></tfoot>

                            <bdo id='aXRvc'></bdo><ul id='aXRvc'></ul>

                            <small id='aXRvc'></small><noframes id='aXRvc'>

                          • <legend id='aXRvc'><style id='aXRvc'><dir id='aXRvc'><q id='aXRvc'></q></dir></style></legend>