RDS Proxy on MySQL Lambda Function (C# .Net Core 3.1 Runtime)

0

I have a Lambda function written in c# .net core 3.1 runtime. In which I am using MySQL for some DB-related stuff. I want to use RDS Proxy on this function (will apply to other functions later) as my application is making too many connections. I've searched on the internet about how to apply RDS Proxy in code level with MySQL connector in c# (.NEt core 3.1 runtime) but couldn't find anything helpful. I want to integrate proxy settings on MySQL connector object but as my finds on the internet MySQL doesn't support settings for proxy. I'll really appreciate it if you can provide any code sample for connecting MySQL with rds proxy in c#.

1 Answer
1

Check this article out :)

You don't need to add proxy, you just need to change the connection string in your Lambda, everything else is handled by AWS.

Of course, you need to set up RDS Proxy, but in the code, there is almost nothing to be done and it doesn't matter if you are using .net.

profile picture
MG
answered 2 years ago
  • I have this line here, When I pass the rdsProxyEndpoint it gives an error (mentioned below). It is failing because the connection string isn't good or in a standard format. I have tried to hard code the RDS Proxy Endpoint but it still gives the same error. Any solution for this?

    DbConnection connection = new MySqlConnection(rdsProxyEndpoint); //error appears here

    Error: Format of the initialization string does not conform to specification starting at index 0

  • I think there must be something wrong in the connection string hmmm

    Could you verify your connection string using this article?

    You can also check this thread about how connection string should be formatted.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions