Невозможно запустить AWS CLI в пользовательской среде Lambda, появляется ошибка:
команда aws не найдена
python3 -m venv lambdaVirtualEnv
source activate lambdaVirtualEnv
pip3 install awscli
copied the aws binary and contents under the site-packages to lambdaLayerDir
Created a lambda layer using lambdaLayerDir.zip file.
function handler ()
{
PATH=${PATH}:${LAMBDA_TASK_ROOT}
echo $PATH
EVENT_DATA=$1
RESPONSE="{\"statusCode\": 200, \"body\": \"Hello from Lambda!\"}"
echo $RESPONSE
aws
}
Выход:
> * Connection #0 to host 127.0.0.1 left intact
/var/task/hello.sh: line 9: aws: command not found
END RequestId: b2225b95-c53c-4271-a664-873dc19528b4
REPORT RequestId: b2225b95-c53c-4271-a664-873dc19528b4 Init Duration: 33.70 ms Duration: 431.44 ms Billed Duration: 500 ms Memory Size: 128 MB Max Memory Used: 45 MB
RequestId: b2225b95-c53c-4271-a664-873dc19528b4 Error: Runtime exited with error: exit status 127
Runtime.ExitError