amplify-cli icon indicating copy to clipboard operation
amplify-cli copied to clipboard

Amplify push suddenly failing

Open mnikolic10 opened this issue 1 year ago • 2 comments

Amplify CLI Version

14.0.0

Question

I made some minor changes to a custom Cognito trigger lambda and have not been able to successfully push since. I was previously working with the same lambda and pushes succeeded and worked as expected before suddenly beginning to fail.

My backend is not stuck in a loop of CloudFormation requiring a rollback and subsequent pushes failing. The output of my push is as follows:

The following resources failed to deploy: 🛑 Resource is not in the state stackUpdateComplete

I have also seen:

(AWS::AppSync::ApiKey), Event Type: update, Reason: API key must be valid for a minimum of 1 days. (Service: AWSAppSync; Status Code: 400; Error Code: ApiKeyValidityOutOfBoundsException

I have tried the following without any luck:

  • Adding "CreateAPIKey": 0 to parameters.json
  • Adding APIKeyExpirationEpoch: -1 to parameters.json
  • Upgrading my CLI to latest
  • Verifying my AppSync API keys and their expiration date
  • Running Amplify update api to regenerate keys

I am not sure what is going wrong and what i can do to fix, please let me know if there is something I have missed.

mnikolic10 avatar Jul 05 '25 04:07 mnikolic10

Happy to close, i resolved the issue.

For anyone facing this issue, managed to resolve by deleting the AppSync API key manually and creating a new one. I then set "CreateAPIKey": 0 and ran amplify push -y. Not sure why i was previously failing even with a valid expiration date but this solved my issue and pushes run successfully now.

mnikolic10 avatar Jul 06 '25 01:07 mnikolic10

This issue is now closed. Comments on closed issues are hard for our team to see. If you need more assistance, please open a new issue that references this one.

github-actions[bot] avatar Jul 06 '25 01:07 github-actions[bot]