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?

質問済み 1年前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.

回答済み 1年前
  • 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
エキスパート
回答済み 1年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ