Skip to content

Commit

Permalink
lambda: executable name needs to be "bootstrap" with updated Go runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
joonas-fi committed Sep 13, 2024
1 parent f9b94bc commit 247c61d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions build-go-project.sh
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,13 @@ function packageLambdaFunction {
# run in subshell because we need to change paths
(
cd rel/
cp "${BINARY_NAME}_linux-amd64" "${BINARY_NAME}"
# the executable name needs to be "bootstrap". unfortunately one can't easily add file to zip
# with another name, so let's just create a hardlink to not need a temporary copy.
# https://aws.amazon.com/blogs/compute/migrating-aws-lambda-functions-from-the-go1-x-runtime-to-the-custom-runtime-on-amazon-linux-2/
ln "${BINARY_NAME}_linux-amd64" bootstrap
rm -f lambdafunc.zip
zip lambdafunc.zip "${BINARY_NAME}"
rm "${BINARY_NAME}"
zip lambdafunc.zip bootstrap
rm bootstrap

# if we have deployerspec/ directory, package it into release directory
if [ -d ../deployerspec ]; then
Expand Down

0 comments on commit 247c61d

Please sign in to comment.