Skip to content

Help Needed with AWS Glue Studio Redshift Connection Issue

0

Hello everyone, I'm currently trying to create a connection to Amazon Redshift ServerLess using AWS Glue Studio, but I'm encountering the following error:

Failed to create connection: InvalidInputException: [REDSHIFT requires PhysicalConnectionRequirements]

Interestingly, when I use the JDBC CLI command (aws glue create-connection), the connection is successfully created and tested. However, when I try to run a Glue job using that connection, I get this error:

The job failed due to a database connectivity problem as evidenced by the SQLException. The error occurred during the initial connection attempt to establish communication with the database, preventing any actual data processing from taking place. This is corroborated by the very low worker utilization and lack of completed Spark jobs.

Has anyone faced a similar issue or knows how to properly configure the Redshift connection in Glue Studio to avoid this error?

Any help would be greatly appreciated!

Thanks in advance,

asked a year ago390 views

1 Answer
0

It appears you're experiencing connectivity issues between AWS Glue and Amazon Redshift Serverless. This is a common problem that typically stems from network configuration or permission issues. Let me help you troubleshoot this.

For the first error (InvalidInputException: [REDSHIFT requires PhysicalConnectionRequirements]), when creating a Redshift connection in Glue Studio, you need to provide the physical connection requirements, which include VPC, subnet, and security group information. This is required for Redshift connections but might not be explicitly prompted for in the UI.

For the second error (database connectivity problem), there are several potential causes:

  1. VPC Endpoints: You need to set up the necessary VPC endpoints with private DNS enabled for:
  • AWS KMS (interface type)
  • S3 (gateway type)
  • AWS Secrets Manager (interface type)
  • Redshift (interface type)
  • Security Token Service (STS) (interface type)
  1. IAM Permissions: Ensure your IAM role has the required permissions for:
  • S3 access
  • GlueServiceRole permissions
  • SecretsManager access
  • KMS permissions
  • Redshift permissions (including DescribeClusters and, for Redshift Serverless, ListWorkgroups and ListNamespaces)
  1. Security Groups: Verify your security groups allow:
  • Inbound traffic from Glue to Redshift (typically on port 5439)
  • Outbound traffic to S3, Secrets Manager, KMS, and STS
  1. Network ACLs: Check if there are any Network ACLs blocking traffic between Glue and the required services.

  2. Trust Relationships: Make sure Redshift is included as one of the trust relationship principals in your IAM role.

Since the CLI command works but the Glue job fails, it suggests that the connection parameters are correct, but there might be networking or permission issues when Glue tries to use the connection during job execution.

To resolve this, I recommend adding all the necessary VPC endpoints mentioned above and reviewing your IAM permissions. The Version 2 Redshift connection for Glue has some specific requirements that might differ from Version 1, which could explain why you're facing these issues.
Sources
The new version 2 redshift connection for Glue fails | AWS re:Post
Glue Connection (Version 2) for redshift | AWS re:Post
Troublehsoot AWS Glue connection to a JDBC data source | AWS re:Post

answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.