31

Has anybody come up with a good solution to source control and deploy code to AWS Lambda? I really hate that I have to zip the files all the time and upload them. Is there a better way to do this perhaps a service that pushes code based on changes to Lambda?

5
  • You could use something like Code Ship to deploy it to S3 when you make a push to GitHub, then have lambda read from the S3 Bucket. Commented Jul 28, 2015 at 18:39
  • 4
    You can checkout out github.com/garnaat/kappa. I wrote it so I'm biased but I think it provides a decent deploy tool for Lambda. Commented Jul 28, 2015 at 22:13
  • What language(s) are you using? Commented Jul 30, 2015 at 11:10
  • node.js, are there any other tools that are not CLI? Commented Jul 30, 2015 at 13:26
  • I know the question was about synchronizing source control versions with the published Lambda, but this link may still be useful for people who may arrive at this question. It is more about pinning executable Lambda versions, but still relevant. If you have a method for auto-deploying your source control tags to the target lambda, you could pin them with this. Commented Jun 25, 2016 at 14:55

3 Answers 3

10

You can try Serverless Framework for this. Current beta looks very promising.

Serverless Framework allow you to build entire application without any servers. It combines AWS API Gateway with AWS Lambda functions and supports auto-deployment.

Beta v1 release supports NodeJS only, but they plan to support for all languages.

Project Docs: http://docs.serverless.com/v0.5.0/docs

Sign up to request clarification or add additional context in comments.

1 Comment

I tried out serverless and despite the ten thousand stars on github, I had to fight with it a lot, and it still left junk hanging around in my AWS account that was hard to clean up manually. Definitely promising, but not there yet.
4
#!/bin/bash
cd /your/workspace

#zips up the new code
zip -FSr yourzipfile.zip . -x *.git* *bin/\* *.zip

#Updates function code of lambda and pushes new zip file to s3bucket for cloudformation lambda:codeuri source
aws lambda update-function-code --function-name  arn:aws:lambda:us-west-2:YOURID:function:YOURFUNCTIONNAME --zip-file fileb://yourzipfile.zip
aws s3 cp yourzipfile.zip s3://yourbucketname/yourzipfile.zip

Depends on aws-cli install and aws profile setup

aws --profile yourProfileName configure

And my rant: I wish cloudformation lambda:codeuri would accept any url not just s3://bucketname/filename... so I could point it straight to github.

Comments

0

If you use Eclipse, you can utilize AWS Toolkit for Eclipse: link. This allows you to use any source control you want and deploy your code to AWS with two clicks.

1 Comment

any source control you want as long as your lambda is written in java...

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.