I'm trying to set up a AWS Glue job and make a connection to Redshift.
I'm getting error when I set the connection type to Redshift:
"Unable to find a suitable security group. Change connection type to JDBC and retry adding your connection."
Following what was said here in these forums, I added permissions to my IAM account for role AWSGlueServiceRoleDefault
:
I then set up the job with the matching IAM role AWSGlueServiceRoleDefault
:
I need to store the Glue data in Redshift DB, so I chose JDBC then added a connection:
As soon as I choose Redshift
, it complains that it cannot find a suitable security group. Why is this?
In the left navigation pane, choose Clusters. Choose the cluster name that you want to access from AWS Glue. In the Cluster Properties section, choose a security group in VPC security groups to allow AWS Glue to use. Record the name of the security group that you chose for future reference.
An AWS Glue connection is a Data Catalog object that stores login credentials, URI strings, virtual private cloud (VPC) information, and more for a particular data store. AWS Glue crawlers, jobs, and development endpoints use connections in order to access certain types of data stores.
I found the same issue when trying to connect Glue with Amazon RDS (MySQL) and solved it following the AWS Glue guidelines -> Setting Up a VPC to Connect to JDBC Data Stores.
In a nutshell you should check that the security group associated to your RedShift cluster allows self-referencing traffic.
Hope that works!
You have to create a:
1)AWSGlueServiceRole
role and attach s3FullAccess,GlueServiceRole
and RedshiftFullAccess
policy.
2)Check you have vpc Endpoint, If not create a VPC endpoint and make sure subnets are added to route table. 3)Create self referencing security group.
Now connect using JDBC connection,
jdbc:type://xxxx:port/databasename
type is redshift/postgresql/etc
...
xxxx: server name
where the database hosted.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With