Skip to content

Commit

Permalink
Fix: s3Prefix actually works for createLambda
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Hutchison committed Feb 15, 2017
1 parent 56e92f3 commit 87a24f6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/main/scala/com/gilt/aws/lambda/AwsLambda.scala
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ private[lambda] object AwsLambda {
handlerName: HandlerName,
roleName: RoleARN,
s3BucketId: S3BucketId,
s3Prefix: String,
timeout: Option[Timeout],
memory: Option[Memory]
): Try[CreateFunctionResult] = {
Expand All @@ -60,7 +61,7 @@ private[lambda] object AwsLambda {
val functionCode = {
val c = new FunctionCode
c.setS3Bucket(s3BucketId.value)
c.setS3Key(jar.getName)
c.setS3Key(s3Prefix + jar.getName)
c
}

Expand Down
3 changes: 2 additions & 1 deletion src/main/scala/com/gilt/aws/lambda/AwsLambdaPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ object AwsLambdaPlugin extends AutoPlugin {
AwsS3.pushJarToS3(jar, resolvedBucketId, resolvedS3KeyPrefix) match {
case Success(s3Key) =>
for ((resolvedLambdaName, resolvedHandlerName) <- resolvedLambdaHandlers) yield {
AwsLambda.createLambda(resolvedRegion, jar, resolvedLambdaName, resolvedHandlerName, resolvedRoleName, resolvedBucketId, resolvedTimeout, resolvedMemory) match {
AwsLambda.createLambda(resolvedRegion, jar, resolvedLambdaName, resolvedHandlerName, resolvedRoleName,
resolvedBucketId, resolvedS3KeyPrefix, resolvedTimeout, resolvedMemory) match {
case Success(createFunctionCodeResult) =>
resolvedLambdaName.value -> LambdaARN(createFunctionCodeResult.getFunctionArn)
case Failure(exception) =>
Expand Down

0 comments on commit 87a24f6

Please sign in to comment.