Lambda function -- lambda layer

0

Hello,

I have created a lambda function which is connected to a lambda layer that stores some packages. I have created a hosting environment connected to the github repository where the frontend of my application is. The issue is that whenever I push something to github and the hosting environment redeploys, it creates a new version for the lambda layer automatically and uses that, which breaks the application. After each push on github I have to manually go to the lambda function and switch back to my version of the lambda layer.

How can I prevent it from automatically updating the layer?

질문됨 일 년 전337회 조회
2개 답변
0

Hey, thanks for the answer. I don't think I'm using Github Actions. What I did is open the app from the Amazon Amplify page ( https://eu-west-3.console.aws.amazon.com/amplify/home) > Hosting Environments > Connect Branch, and there I connected my github repository. I didn't make any specific changes myself and the backend files are not even in that github branch; that branch only contains the front-end of the application.

답변함 일 년 전
  • Ok. Understood. Then forget my proposal. Sorry for not being able to help further.

0

Hi, if I understand correctly, you are using Github Actions on Github to build your code each time you commit something new.

If this is correct, what you can do is to create a hook that takes different actions depending on the path of committed file.

For example, use this one: https://github.com/dorny/paths-filter

If you want to do it all by yourself, read https://www.techielass.com/trigger-a-github-action-workflow-when-a-folder-changes/ section "GitHub Actions triggers" will explain how to distinguish paths of updated file,

Then, you can

  1. launch and build the lambda if one of its files get modified
  2. build lambda layer and push it only if one of its files get modified. In that case, you may also want to build and push the lambda.

I hope that my initial guess about GitHub Actions was correct (you did not give details). Otherwise you can forget the above... ;-)

Didier

profile pictureAWS
전문가
답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠