JPV
JPV

Reputation: 17

Issue creating a Glue job on AWS CDK

i am trying to add default arguments to a glue job on AWS CDK, specifically the bookmark option enabled. keep on getting the same error:

Error: Resolution error: Supplied properties not correct for "CfnJobProps" defaultArguments: "--job-bookmark-option: job-bookmark-enable" should be an 'object'.

my bode is below:

    glueETLJob = _glue.CfnJob(
        self,
        glueJobName,
        command =_glue.CfnJob.JobCommandProperty(
            name = glueJobName,
            python_version= '3',
            script_location = config_bucket_arn + "/code/gluejob.py"
        ),
        role=glueJobRole.role_arn,
        glue_version='1.0',
        max_retries=0,
        timeout=30,
        security_configuration=glueSecurityConfiguration.ref,
        default_arguments=str("--job-bookmark-option: job-bookmark-enable"),
        description="glue job"
    )

Upvotes: 1

Views: 2808

Answers (1)

Prabhakar Reddy
Prabhakar Reddy

Reputation: 5144

As the error indicates you need to pass default_arguments as an object as shown below :

default_arguments={ '--job-bookmark-option': 'job-bookmark-enable' }

It is weird though as CDK Guide says that you can pass any data type but this doc here says it has to be JSON for default_arguments

Also filed https://github.com/awsdocs/aws-cdk-guide/issues/251 to confirm and update the doc if required.

Upvotes: 8

Related Questions