0

I am attempting to connect to Redshift using the RPostgres package.

Normally this works fine, however I am using VPN to connect to my companies network.

Running the following, with placeholders for sensitive info obviously:

library(RPostgres)
con <- dbConnect(RPostgres::Postgres(),
                     dbname = "db",
                     host = "host.redshift.amazonaws.com",
                     port = 5439,
                     user = 'me',
                     password = 'password',
                    sslmode = 'require')

Getting the following error:

Error in connection_create(names(opts), as.vector(opts)) : could not connect to server: Operation timed out Is the server running on host "host.redshift.amazonaws.com" (IP Address) and accepting TCP/IP connections on port 5439?

I am not familiar with VPN or how it may effect connections.

Apologies for the generality of this question, however hoping there are some ideas to at least get me started on finding a solution.

Devin
  • 363
  • 2
  • 20

1 Answers1

0

Go to your Redshift console, and see the security group which is used for your Redshift cluster, in the security group settings, view Inbound settings, those should have enabled connections from your IP. But as you're using a VPN, IP being allotted to you by the VPN might not have been allowed to connect as an inbound connection.

So either you can permit a range of IPs to connect via the security group inbound permissions, or permit all IPs to connect.

Shailesh
  • 2,116
  • 4
  • 28
  • 48