Skip to content

Commit 1834cfd

Browse files
author
Pete Dishman
committed
Detect connections to AWS RDS Proxy and update Server ID on connection
Signed-off-by: Pete Dishman <[email protected]>
1 parent 9db104f commit 1834cfd

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/MySqlConnector/Core/ServerSession.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1898,6 +1898,13 @@ private bool ShouldGetRealServerDetails(ConnectionSettings cs)
18981898
HostName.EndsWith(".mysql.database.chinacloudapi.cn", StringComparison.OrdinalIgnoreCase);
18991899
}
19001900

1901+
// detect AWS RDS Proxy, if hostname like <name>.proxy-<random-chars>.<region>.rds.amazonaws.com
1902+
if (HostName.EndsWith(".rds.amazonaws.com", StringComparison.OrdinalIgnoreCase) &&
1903+
HostName.Contains(".proxy-", StringComparison.OrdinalIgnoreCase))
1904+
{
1905+
return true;
1906+
}
1907+
19011908
return false;
19021909
}
19031910

0 commit comments

Comments
 (0)