This plugin allows ITV ScalaJS lambdas to be deployed to AWS.
To use it:
-
Have to have a
lambda-exports.js
file in resources folder which calls main scala function like this:const <moduleName> = require("<functionName>-opt.js"); exports.handler = function(event, context) { <moduleName>.<MainObject>.<functionName>(event, context); }
-
Put
addSbtPlugin("com.itv" % "conan" % "0.1")
to yourplugins.sbt
-
And
enablePlugins(ConanPlugin)
in yourbuild.sbt
-
In project settings in
build.sbt
you needqaConanConfig
andprdConanConfig
taskKeys. These should contain:publishLambdaConfigBuilder .withName(<funtionName>) .withFunctionHandler(<handlerName>) .withRegion(<AWS region>) .withEventSourceArn(eventArn) .withLambdaRoleArn(roleArn)