title: How to create an AWS Lambda function from a Clojure project or a jar?
body: <p>The Amazonica test for the AWS Lambda API (<a href="https://github.com/mcohen01/amazonica/blob/master/test/amazonica/test/lambda.clj" rel="nofollow">link</a>) shows a simple example of creating a Lambda function from a Javascript blob (<code>role</code> is an ARN string for a role that can create Lambdas):</p>
  
  <pre><code>(def handler "exports.helloWorld = function(event, context) {
                    console.log('value1 = ' + event.key1)
                    console.log('value2 = ' + event.key2)
                    console.log('value3 = ' + event.key3)
                    context.done(null, 'Hello World')
                  }")
  
  (create-function :role role :function handler)
  </code></pre>
  
  <p>Does anyone know if <code>create-function</code> can create a Lambda from a jar? Would simply passing a file stream or a binary string of the jar to <code>create-function</code> be a bad idea, even if it did work?</p>
  
  <p>I suppose I could just use a bash script with the AWS CLI to create a Lambda from a jar, but first I wanted to check if there is a known straightforward method of doing this in Clojure.</p>
  
  <p>Another option would be to upload the jar to an S3 bucket and then let a CloudFormation script deploy it, based on the example <a href="http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#d0e62987" rel="nofollow">here</a>. It seems a little silly though, to have an S3 bucket just to hold build artefacts, when Lambda will be storing them itself.</p>