1

I am building an ETL Application that needs to fetch data from Heroku Postgres DB a few times a day but the application is not running on Heroku, I am already able to do this, but using the current credentials, but heroku states that the credentials are not permanent and will be rotated from time to time.

What is the best way to do this, building a REST API on top of my app is not viable an option. I have seen that Heroku provides a config vars API which I could potentially use to fetch the DB credentials, but is there a simpler/cleaner way for implementing this, is enforcing permanent credentials an option?

1 Answer 1

1

There is no way to enforce it. And it's not a question of credentials, but a question of a database hostname. It's ec2.

Your safest bet is to always fetch current DATABASE_URL from your Heroku app. If you only need to do it 'a few times a day' this is not a problem.

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

3 Comments

What is the most secure way to fetch the DATABASE_URL from heroku?
The best way to do this is to use their platform-api (devcenter.heroku.com/articles/…) You can call it from the shell using curl as in their example or using heroku config:get DATABASE_URL command. Or you can use your preferred language library.
Thanks, this us what I ended up doing and it is working well for me so far

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.