Search code examples
amazon-web-servicesaws-cloudformationaws-glue

AWS CloudFormation Package Glue Extra Python Files


I am trying to use Cloudformation package to include the glue script and extra python files from the repo to be uploaded to s3 during the package step.

For the glue script it's straightforward where I can use

  Properties:
  Command:
    Name: pythonshell #glueetl -spark # pythonshell -python shell...
    PythonVersion: 3
    ScriptLocation: "../glue/test.py" 

But how would I be able to do the same for extra python files? The following does not work, it seems that I could upload the file using the Include Transform but not sure how to reference it back in extra-py-files?

      DefaultArguments: 
      "--extra-py-files": 
        - "../glue/test2.py"

Solution

  • Sadly, you can't do this. package only supports for glue:

    Command.ScriptLocation property for the AWS::Glue::Job resource

    Packaging DefaultArguments arguments is not supported. This means that you have to do it "manually" (e.g. create bash script) outside of CloudFormation.