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



  • 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

已提問 10 個月前檢視次數 364 次
1 個回答

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
已回答 10 個月前

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