Unable to connect cdk glue job to data connection

0

Hi, I have created a glue job and a data connection using AWS CDK. But when I run the job I am getting this error --- "failed to execute with exception Unable to resolve any valid connection (Service: AWSGlueJobExecutor; Status Code: 400; Error Code: InvalidInputException; Request ID: d69c5e2e-04fb-4beb-8af0-f520caa0767b; Proxy: null)";

The following cdk code I have used --

new CfnConnection(this, `test-postgresql-connection`, {
    catalogId: this.account,
    connectionInput: {
      connectionProperties: {
        JDBC_CONNECTION_URL:'jdbc:postgresql://*******************************',
        JDBC_DRIVER_CLASS_NAME:'org.postgresql.Driver',
        JDBC_DRIVER_JAR_URI:'postgresql-42.6.0.jar URI',
        SECRET_ID: `******************`,
      },
      connectionType: 'JDBC',
      name: `test-connection`,
      physicalConnectionRequirements: {
        securityGroupIdList: ['******************'],
        subnetId: '***********************',
      },
    },
});


new CfnJob(this, `test-glue-job`, {
        name: 'GlueJob Name',
        role: '**********************',
        command: {
          name: 'glueetl',
          pythonVersion: '3',
          scriptLocation: `****************************`
        },
        glueVersion: '4.0',
        numberOfWorkers: 20,
        workerType: 'G.1X',
        executionProperty:{
          maxConcurrentRuns: 10
        },
        connections: {
            connections:[`test-connection`]
        }

    });

Please help with your valuable suggestions. TIA.

1 Answer
0

By the message, I suspect there is something wrong with the physicalConnectionRequirements, maybe the availabilityZone is required (even though it's determined by the subnet)

profile pictureAWS
EXPERT
answered 6 months 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.

Guidelines for Answering Questions