amplify lambda environment variables issue, added, removed and now push doesn't work

0

I

  • added an env variable with amplify function update.
  • then removed it with the same command
  • the functions folder is practically the same as in in the #current-cloud-backend

and yet I am getting error that there is no [env] in template

🛑 Resource is not in the state stackUpdateComplete
Name: function...DefineAuthChallenge (AWS::CloudFormation::Stack), Event Type: update, Reason: Parameters: [env] do not exist in the template, IsCustomResource: false

I checked and ensured that the function template does contain the corresponding Parameter.. Just in case I even tried to remove the parameter and push again - it is still stuck on this error

I guess it may be related to the latest amplify upgrade - current amplify version is 12.5.1

Arsen
已提問 7 個月前檢視次數 292 次
1 個回答
0

Not sure what the original issue was, but here are the steps that resolved the problem for me

  • I deleted the functions with amplify update auth (the function were auto generated as Cognito triggers so auth depends and control them)
  • amplify push to successfully deploy the deletion
  • amplify update auth and select through walk-through the needed triggers
  • amplify function update to add back the environment variables - although in my case I added a resource permissions which in case automatically added env variable with the DynamoDB table names, so I no longer needed my previous environment variables
  • amplify push now successfully pushed the functions with
Arsen
已回答 7 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南