pipecd icon indicating copy to clipboard operation
pipecd copied to clipboard

Deploy binary file from specified url as Lambda function

Open chaspy opened this issue 4 years ago • 0 comments

Hello maintainers.

There are three ways to Deploy a Lambda Function, as described in this page. https://pipecd.dev/docs/user-guide/configuring-deployment/lambda/

When Deploying Go, the Deploy source code directly as Lambda function method does not work well. This is because the built binary is usually not committed. (Nodejs, any other language would work)

Therefore, we can either build it as a container image and push it to the Image Registry (Deploy container image as Lambda function(, or compress the built binary into a zip file and transfer it to S3 (Deploy .zip file archives as Lambda function ) .

How about uploading the built binary to a specific location such as GitHub Release and using it from PipeCD?

apiVersion: pipecd.dev/v1beta1
kind: LambdaFunction
spec:
  name: SimpleCanaryZipFunction
  role: arn:aws:iam::76xxxxxxx:role/lambda-role
  # source configuration use to determine the source code of your Lambda function.
  source:
    # git remote address where the source code is placing.
    url: https://github.com/chaspy/lambda-go-example/releases/download/v0.1.8/lambda-go-example
    path: lambda-go-example
  handler: app.lambdaHandler
  runtime: go1.x
  memory: 128
  timeout: 5
  tags:
    app: canary-zip

This will allow us to share the built Go binary more freely.

chaspy avatar Jan 20 '22 16:01 chaspy