Skip to content

Instantly share code, notes, and snippets.

@kenjij
Created September 27, 2025 05:34
Show Gist options
  • Select an option

  • Save kenjij/f638e553462573d03e21e822d09b597f to your computer and use it in GitHub Desktop.

Select an option

Save kenjij/f638e553462573d03e21e822d09b597f to your computer and use it in GitHub Desktop.
Preparing Go (golang) executable as AWS Lambda function using zip file
#
# 1. Create AWS Lambda function:
# Runtime - Amazon Linux 2023
# Architecture - arm64
# 2. Build the Go executable packaged into a zip file
# 3. Upload the zip file
#
all: build package
build:
GOOS=linux GOARCH=arm64 go build -o bootstrap main.go
package:
zip lambda-handler bootstrap
zipinfo -t lambda-handler
clean:
rm -fv bootstrap
rm -fv lambda-handler.zip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment