Skip to content

Commit

Permalink
Merge pull request #10 from stjohnb/master
Browse files Browse the repository at this point in the history
Minor code cleanups
  • Loading branch information
fiadliel committed Nov 15, 2015
2 parents 1f45db2 + 00c60a7 commit 8b49bfb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/scala/com/gilt/aws/lambda/AwsLambdaPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -83,22 +83,22 @@ object AwsLambdaPlugin extends AutoPlugin {

AwsS3.pushJarToS3(jar, resolvedBucketId) match {
case Success(s3Key) =>
(for ((resolvedLambdaName, resolvedHandlerName) <- resolvedLambdaHandlers) yield {
for ((resolvedLambdaName, resolvedHandlerName) <- resolvedLambdaHandlers) yield {
AwsLambda.createLambda(resolvedRegion, jar, resolvedLambdaName, resolvedHandlerName, resolvedRoleName, resolvedBucketId, resolvedTimeout, resolvedMemory) match {
case Success(createFunctionCodeResult) =>
resolvedLambdaName.value -> LambdaARN(createFunctionCodeResult.getFunctionArn)
case Failure(exception) =>
sys.error(s"Failed to create lambda function: ${exception.getLocalizedMessage}\n${exception.getStackTraceString}")
}
}).toMap
}
case Failure(exception) =>
sys.error(s"Error upload jar to S3 lambda: ${exception.getLocalizedMessage}")
}
}

private def resolveRegion(sbtSettingValueOpt: Option[String]): Region = {
sbtSettingValueOpt match {
case Some(region) => Region(region)
case Some(regionSetting) => Region(regionSetting)
case None => sys.env.get(EnvironmentVariables.region) match {
case Some(envVarRegion) => Region(envVarRegion)
case None => promptUserForRegion()
Expand Down

0 comments on commit 8b49bfb

Please sign in to comment.