Reputation: 59
I am trying to to deploy a Python/Django app on Heroku that needs to execute read-only queries on a Redshift cluster. The primary problem is that the app has a dynamic IP address, but Redshift needs specific IP addresses to be whitelisted.
I would prefer to be able to query the cluster programmatically using the psycopg2 engine or the AWS SDK (Boto). One possibility would be to use a Heroku add-on such as Proximo or QuotaGuard Static to obtain a static IP address, but:
Has anyone else dealt with this problem before? Thanks in advance for any help!
I can connect to Redshift locally, but how do I do so once the app is deployed onto Heroku? I've tried using the Boto3 SDK and a static ip Heroku add-on like QuotaGuard Static or Proximo.
Upvotes: 1
Views: 357
Reputation: 59
I was able to solve this issue by using the Proximo add on using the steps here:
https://devcenter.heroku.com/articles/proximo#provisioning-the-proximo-add-on
In order to route only the Redshift queries, I used the Proximo mask described here:
https://devcenter.heroku.com/articles/proximo#configuring-the-proximo-wrapper
Edited
Provisioning the Proximo add-on
$ heroku addons:create proximo:development
$ heroku config | grep PROXIMO_URL
$ heroku addons:create proximo:development
Installing the Proximo wrapper
cd ~/myapp
$ curl http://downloads.proximo.io/proximo-stacklet.tgz | tar xz
$ git add bin/proximo vendor/dante
$ git commit -m "add proximo stacklet"
Modify your Procfile to prepend bin/proximo to any command whose connections you would like to forward through your proxy: web: bin/proximo [your existing command]
To use the Proximo mask:
By default, the bin/proximo wrapper will forward all outbound traffic from the wrapped process across your proxy. If you’d like to send only a subset of traffic, you can limit with PROXIMO_MASK:
heroku config:set PROXIMO_MASK="172.18.32.0/24"
Upvotes: 1