Warm tip: This article is reproduced from stackoverflow.com, please click
amazon-web-services aws-glue aws-security-group

aws rds/mysql security group for aws-glue python shell jobs

发布于 2020-04-21 11:06:39

I have a Python shell job in aws-glue that talks to a rds/mysql server. I receive an error when running the job saying below. I guess it is the mysql server's security group settings. How can I update the SG to allow the connection from the aws-glue job?

mysql.connector.errors.InterfaceError: 2003: Can't connect to MySQL server on xxxxx.rds.amazonws.com:3306

I use python mysql-mysql-connector in my code to talk to the mysql server

    conn = connector.connect(user='dustin', password='sun',
                              host='xxxx.us-east-1.rds.amazonaws.com',
                              database='mydb')
    cursor = conn.cursor(dictionary=True)
    cursor.execute(sql)
Questioner
Dustin Sun
Viewed
61
Prabhakar Reddy 2020-02-07 12:39

It looks like you need to modify the security groups so that connections are accepted from Glue job.As you didn't mention your security groups in your question it is hard to tell what might be the issue. So refer to this link and make sure that you are configuring them properly.