Search code examples
amazon-web-servicesaws-lambdaamazon-rdsserverlessserverless-framework

How can I connect to an existing RDS database using AWS CloudFormation?


I am building a serverless app and want to connect to an existing database. How would I go about doing this?


Solution

  • Connection to the DB is not something infra-related but functional. So you will have in the code the connection to the DB and call to cursors.

    Exception: If you use app-sync for your API with direct calls (not lambda), you can declare the DB and make calls to it directly.