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 Antwort
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
EXPERTE
beantwortet vor 6 Monaten

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen