How do we upload lambda function .zip directly from CLI?

Viewed 172

I use Ubuntu and have this Golang lambda function with Redis. Already zipped and uploaded it. But I still need to develop it further.

Every time I made changes and want to see the logs in CloudWatch... It seems that I need to do the steps over and over.

code -> build main.go -> zipped -> upload it -> trigger the function -> see the logs

ineffective.

is there a way to simplify the steps?

is it possible to upload it through CLI?

thank you!

1 Answers

You can upload using the cli:

aws lambda update-function-code \
    --function-name  my-function \
    --zip-file fileb://my-function.zip

you can see this particular example in the docs.

The other steps should be pretty easy to automate with a simple script.

Related