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

feita há 10 meses366 visualizações
1 Resposta

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
respondido há 10 meses

Você não está conectado. Fazer login para postar uma resposta.

Uma boa resposta responde claramente à pergunta, dá feedback construtivo e incentiva o crescimento profissional de quem perguntou.

Diretrizes para responder a perguntas