Skip to content

Commit 247c61d

Browse files
committed
lambda: executable name needs to be "bootstrap" with updated Go runtime
1 parent f9b94bc commit 247c61d

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

build-go-project.sh

+6-3
Original file line numberDiff line numberDiff line change
@@ -197,10 +197,13 @@ function packageLambdaFunction {
197197
# run in subshell because we need to change paths
198198
(
199199
cd rel/
200-
cp "${BINARY_NAME}_linux-amd64" "${BINARY_NAME}"
200+
# the executable name needs to be "bootstrap". unfortunately one can't easily add file to zip
201+
# with another name, so let's just create a hardlink to not need a temporary copy.
202+
# https://aws.amazon.com/blogs/compute/migrating-aws-lambda-functions-from-the-go1-x-runtime-to-the-custom-runtime-on-amazon-linux-2/
203+
ln "${BINARY_NAME}_linux-amd64" bootstrap
201204
rm -f lambdafunc.zip
202-
zip lambdafunc.zip "${BINARY_NAME}"
203-
rm "${BINARY_NAME}"
205+
zip lambdafunc.zip bootstrap
206+
rm bootstrap
204207

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

0 commit comments

Comments
 (0)