- Newest
- Most votes
- Most comments
You can't, in a notebook you use a read cluster called interactive session, the docker container has many limitations.
You can still reference the connection inside the code but any jars it provides you have to provide yourself and it cannot put that docker container inside a VPC if the connection specifies one, as seems to be your case.
You would need to run the docker container in an instance that is already inside the VPC, which is probably not worth the hassle and not practical for development.
Either use a local DB for testing or move to interactive sessions with notebooks.
Hi, we have a similar use-case. We have a redshift cluster in private VPC. Glue jobs are reading from redshift DB using IAM-based url (in glue 4.0) and with glue role having permissions to retrieve temp db credentials from redshift for authentication with which no need to config any user/password. Additionally, we need to attach a glue connection (NETWORK type, with Redshift Subnet and SG info) to the glue job, and glue sets up ENI with VPC assigning SGs specified in the AWS Glue connection to ENI and enables connection.That way, read via dynamic frame method below works for glue jobs along with iam-based authentication.
df=glue_context.create_dynamic_frame.from_options( connection_type="redshift", connection_options={ "url": "jdbc:redshift:iam://'redshift-cluster:region/db", "query": query_string, "redshiftTmpDir": redshift_dir, "aws_iam_role": redshift_role, "DbUser": "db_user_name" } )
We are trying to achieve the similar iam-based redshift connection in glue local docker set-up, which we use to develop. So, we are trying to locally read from redshift DB using IAM-based url (in glue 4.0) and giving permissions to docker profile role to retrieve temp db credentials from redshift for authentication. As you mentioned it's not possible to set the glue connection from local docker. So for local docker set-up the missing piece is Network access. My question is that if we set-up a SG for our local docker using a security network access client running in local, and allowing inbound traffic to redshift from the local docker SG (that way dealing with network access and no need for glue network connection), would the connection via glue dynamic frame above still work locally? Thanks.
Relevant content
- Accepted Answerasked 10 months ago
- How can I use a Lambda function to automatically start an AWS Glue job when a crawler run completes?AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago