# Connect Lambda function to RDS MySQL

**URL:** <https://forums.swift.org/t/connect-lambda-function-to-rds-mysql/43642>\
**Category:** AWS Lambda Runtime\
**Created:** [January 7, 2021, 5:55pm UTC](https://forums.swift.org/t/connect-lambda-function-to-rds-mysql/43642 "2021-01-07T17:55:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![macsourcerer](https://avatars.discourse-cdn.com/v4/letter/m/dec6dc/32.png) [@macsourcerer](https://forums.swift.org/u/macsourcerer)\
**Post date:** [January 7, 2021, 5:55pm UTC](https://forums.swift.org/t/connect-lambda-function-to-rds-mysql/43642/1 "2021-01-07T17:55:57Z")

</div>

Hi,  
I want to write a Lambda function that connects to a RDS MySQL Database but I have almost no experiences with AWS. Can someone pls push me in the right direction? A tutorial or example code would be helpful too.

Thanks in advance  
Sascha

---

<div class="post-metadata">

**Author:** ![tomerd](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/tomerd/32/3402_2.png) [@tomerd](https://forums.swift.org/u/tomerd)\
**Post date:** [January 8, 2021, 10:14pm UTC](https://forums.swift.org/t/connect-lambda-function-to-rds-mysql/43642/2 "2021-01-08T22:14:42Z")

</div>

Vapor has a MySQL client you should be able to use cc @gwynne

---

<div class="post-metadata">

**Author:** ![richwolf](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/richwolf/32/14080_2.png) [@richwolf](https://forums.swift.org/u/richwolf)\
**Post date:** [July 31, 2023, 8:27pm UTC](https://forums.swift.org/t/connect-lambda-function-to-rds-mysql/43642/3 "2023-07-31T20:27:02Z")

</div>

@macsourcerer … this is probably way, way too late to help you out, but I have created the very kind of Lambda function that you ask for and which @tomerd describes … a Lambda function that uses Vapor's MySQLKit to connect to AWS RDS. I have been considering doing some kind of writeup on it because I figure there must be a least a few folks who want to know how to do this and (so far as I can tell) nobody's really done a writeup on using RDS for Lambda with Swift. Also, I think it might be fun to do a writeup on just MySQLKit…the way that it handles queries in Swift is pretty cool, but a little hard to wrap your head around when just starting out (Vapor's test cases are a great resource though). I doubt this is a still a "thing" for you, but if I can be helpful, feel free to reach out.

---

<div class="post-metadata">

**Author:** ![macsourcerer](https://avatars.discourse-cdn.com/v4/letter/m/dec6dc/32.png) [@macsourcerer](https://forums.swift.org/u/macsourcerer)\
**Post date:** [July 31, 2023, 9:18pm UTC](https://forums.swift.org/t/connect-lambda-function-to-rds-mysql/43642/4 "2023-07-31T21:18:28Z")

</div>

Hey, you are right. But never the less it would still be interesting to learn some thing about that. I ended up not using Lambda or AWS at all. But you never know...  
Though looking forward read your writeup if you write one.
