2

i'm trying to connect to vercel with aws postgres db
I've created an instance of free tier rds and i got endpoint
so this is my server code

 const connection = await createConnection({
type: 'postgres',
url: process.env.DATABASE_URL,
logging: false,
synchronize: false,

entities: [
  User,
],
});

so my main question is how to create url

I've tried DATABASE_URL=postgresql://user:password@my aws endpoint:5432/my aws database name
and not worked vercel error said
ERROR : Task timed out after 10.01 seconds
What did I do wrong?

2 Answers 2

1

Go to the aws rds db instance, down on the right ( once you select the instance) there will be vpc security groups select it and add inbound and outbound firewall rules for the ip you are connecting with, if its your local it will be your wan ip. You can also test it with allow all traffic but I would strongly suggest against it.

Sign up to request clarification or add additional context in comments.

Comments

0

Task timed out is almost always due to wrong or missing firewall rules. Verify that the RDS instance security group(s) has a rule for the vercel server.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.