Search code examples
amazon-web-servicesamazon-ec2amazon-redshiftaccess-controlaws-security-group

Query regarding SQL Workbench access to Redshift cluster endpoint IP Whitelisting


I use a dongle/WiFi to use internet and hence my Public IP is dynamic (changes everyday).

While trying to access SQL Workbench, the IP of the end user has to be added in the default security group under the Network & Security tab of the EC2 dashboard.

Everyday I have to follow this process religiously before starting work on SQL Workbench.

Can anyone guide me to a permanent fix on this?


Solution

  • Permanent fix? No.

    But a simple way to handle it? Yes!

    You can run this script on your computer:

    IP=`curl -s http://whatismyip.akamai.com/`
    aws ec2 authorize-security-group-ingress --group-name "Redshift-SG" --protocol tcp --port 5439 --cidr $IP/32
    

    It will add your current IP address to the Security Group.

    After a while, the security group will fill up, so you'll need to empty it out and start again. (You could automate that too!)