I am trying to create a stack set containing a Glue job, I have a conflict in how the script asset is handled by the Job construct and how the stackset assets are managed during the deployment.
When using the Job construct the code asset expects to receive a single file.
When executing the cdk synth command I get the error: Asset path must be either a .zip file or a directory
If I try using a path to the glue_jobs folder instead I get the error: Code path ./glue_jobs/ is a directory. Only files are supported. This is because the glue.Code.from_asset method expects a single file, not a directory.
I have tried using an Asset construct first but I get the same Asset path must be either a .zip file or a directory error if my asset refers to a single file. Again, if I reference the folder containing the python job script and in the job definition glue.Code. from_bucket instead, the synth and deploy process works but the job is created using the zip file (binary file) as the source so the code is illegible and can't be executed.
thanks for reporting this. to confirm, this works as a regular stack deployment? i will test this out in a bit with the updates that were made in https://github.com/cdklabs/cdk-stacksets/pull/325.
I am trying to create a stack set containing a Glue job, I have a conflict in how the script asset is handled by the Job construct and how the stackset assets are managed during the deployment.
When using the Job construct the code asset expects to receive a single file.
When executing the
cdk synth
command I get the error:Asset path must be either a .zip file or a directory
If I try using a path to the
glue_jobs
folder instead I get the error:Code path ./glue_jobs/ is a directory. Only files are supported
. This is because theglue.Code.from_asset
method expects a single file, not a directory.Another approach:
I have tried using an
Asset
construct first but I get the sameAsset path must be either a .zip file or a directory
error if my asset refers to a single file. Again, if I reference the folder containing the python job script and in the job definitionglue.Code. from_bucket
instead, the synth and deploy process works but the job is created using the zip file (binary file) as the source so the code is illegible and can't be executed.