#!/bin/bash
name=$(basename "$0")
fullPath=$(dirname "$(readlink -f "$0")")
args=("$@")
secretsFile="${SECRETS_FILE}"
if [[ -f "${secretsFile}" ]]; then
while IFS= read -r line; do
line=$(echo "$line" | tr -d '[:space:]')
if [[ $line =~ ^# ]]; then
continue
fi
if [[ $line =~ = ]]; then
key=$(echo "$line" | cut -d '=' -f 1)
value=$(echo "$line" | cut -d '=' -f 2-)
export "$key=$value"
fi
done < "${secretsFile}"
fi
layer_name=$(basename "${AWS_LAMBDA_EXEC_WRAPPER}")
if [[ "${layer_name}" == "${name}" ]]; then
echo "No new layer was specified, unsetting AWS_LAMBDA_EXEC_WRAPPER"
unset AWS_LAMBDA_EXEC_WRAPPER
else
args=("${AWS_LAMBDA_EXEC_WRAPPER}" "${args[@]}")
fi
exec "${args[@]}"
I think I accomplished every comment in Pre-Load Secrets for the wrapper.
I think I accomplished every comment in Pre-Load Secrets for the wrapper.