Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

151
Views
How to connect AWS Aurora serverless database to Next.js app

I am trying to connect my Next app to an Aurora serverless MySQL database instance by I can't get it to work.

I am trying to use the RDS data api, but my Next api functions keep timing out.

Has anyone got any idea how I can achieve this?

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Thank you to everyone for your suggestion. I managed to get this to work.

The server doesn't need to be in the same VPC as the db.

I used this package to connect - data-api-client

Here's how I connected:

const dataApi = require('data-api-client');

const RDS = dataApi({
  secretArn: process.env.SECRET_ARN,
  resourceArn: process.env.RDS_ARN,
  database: process.env.DB_NAME,
  options: {
    region: process.env.REGION,
    accessKeyId: process.env.ACCESS_KEY_ID,
    secretAccessKey: process.env.SECRET_ACCESS_KEY,
  },
});

After turning on the data api on the database, I then had to create a secret in the secrets manager that is connected to the database. Then I created a new I AM role that gave full access to the database and secrets manager.

After that everything worked as expected.

about 4 years ago · Juan Pablo Isaza Report

0

This is likely a security group issue. You need to add the security group that your next app is on to the RDS inbound security group.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!