반응형

상황

AWS의 lambda 안에서 git 명령을 사용하여(execSync를 이용) Run하면,

아래와 같이 '/bin/sh: git: command not found'가 발생한다.

 

2022-07-04T04:21:23.997Z a8ab8b4b-6f54-4775-90a9-1076ba630dc8 INFO proxy: undefined
/bin/sh: git: command not found

 

해결

람다 메인에서 계층에 'Add a layer'로 lambda layer를 추가해준다.

단, 해당 람다와 동일한 리즌에 있는 계층과 연결해야 하므로

아래 github 링크에서 언급한 arn의 리즌을 us-east-1 --> ap-northeast-2(서울)로 바꿔주고 저장한다.

 

 

 

출처

https://github.com/lambci/git-lambda-layer

 

GitHub - lambci/git-lambda-layer: A layer for AWS Lambda that allows your functions to use `git` and `ssh` binaries

A layer for AWS Lambda that allows your functions to use `git` and `ssh` binaries - GitHub - lambci/git-lambda-layer: A layer for AWS Lambda that allows your functions to use `git` and `ssh` binaries

github.com

 

반응형

+ Recent posts