So, this is a bit convoluted, but I think you can do this with a dynamic binding instead of hacking the source code.
The fn emr-client is used like this:
The actual client this is used by the rest of the library is specified by a dynamic var:
(def ^{:dynamic true} *emr* nil)
This binding is first initialized by lemur.core/-main:
(ns (:require [com.climate.services.aws :as emr] ...))
(binding [...
aws-creds (awscommon/aws-credential-discovery)
emr/*emr* (emr/emr aws-creds)]
... )
So in your jobdef, you can create the emr-client however you want, and then wrap the rest using with-binding, kind of like this:
(require '[com.climate.services.aws.emr :as emr] '[com.climate.services.aws.common :as aws])
(with-bindings [emr/*emr* (aws/aws YOUR_EMR_CLIENT (aws/aws-credential-discovery))]
... ; your defcluster, defsteps, etc
Admittedly, this is a little goofy. Ideally Lemur would allow a :region key in the defcluster. Then lemur.core/execute-jobdef could grab the key and, if it not nil, apply a similar with-bindings step around the load-file form. Patches are welcome.
IIRC, the path for the script-runner.jar is the only thing that is region specific. I haven't tried it, but this path will probably work from any region; although a region neutral path would probably be more efficient.
marc