Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS Amplify: Resource is not in the state stackUpdateComplete

Tags:

aws-amplify

I'm setting up aws-amplify to my project. I am facing a problem in amplify push when I configured for the first time it worked fine. now i changed the repository since i had to do sub-tree from the old repo. Now when i do amplify push i get

Resource is not in the state stackUpdateComplete

⠸ Updating resources in the cloud. This may take a few minutes...Error updating cloudformation stack ⠸ Updating resources in the cloud. This may take a few minutes...

Following resources failed

✖ An error occurred when pushing the resources to the cloud

Resource is not in the state stackUpdateComplete An error occured during the push operation: Resource is not in the state stackUpdateComplete

like image 956
Harsha Avatar asked Sep 30 '19 12:09

Harsha


4 Answers

This worked for me:

$ amplify update auth

Choose the option “Yes, use default configuration” (uses the Cognito Identitypool).

Then:

$ amplify push

Another reason can be this

The issue is tied to the selection of this option - Select the authentication/authorization services that you want to use: User Sign-Up & Sign-In only (Best used with a cloud API only) which creates just the UserPool and not the IdentityPool which the rootstack is looking for. It's a bug and we'll fix that.

To unblock, for just the first question, you could select - ❯ User Sign-Up, Sign-In, connected with AWS IAM controls (Enables per-user Storage features for images or other content, Analytics, and more) which would create a user pool as well as as the identity pool and then choose any of the other configurations that you've mentioned above.

like image 165
gildniy Avatar answered Sep 19 '22 09:09

gildniy


As mentioned by others in this thread - the issue comes from one of the resources that you updated locally.

Check which ones did you modify:

$ amplify status

Then remove and add it again, followed by push. The Api is known not to work with updates right now, so you must remove it if you've changed it locally:

$ amplify api remove YourAPIName
$ amplify api add
$ amplify push
like image 21
Paul Alexandru Pop Avatar answered Sep 17 '22 09:09

Paul Alexandru Pop


You can try as below

First do

amplify env checkout {environment} and then

amplify push

like image 31
user3358326 Avatar answered Sep 18 '22 09:09

user3358326


I got this after making some modifications to my GraphQL schema. I adjusted the way I was making @connection directives on a few tables. I was able to fix this by following these steps:-

  1. Make a backup copy of your new schema that you're trying to push
  2. Run amplify pull to restore your local to be in sync with your backend in the cloud.
  3. Once that completes, you should have the local synced to the cloud and amplify push should work without flaws because it is synced to the cloud and there should be no updates.
  4. Copy over the new schema onto the pulled schema and try running the amplify push once more to see if it works.

If it doesn't work, undo the overwrite to the pulled schema and compare what is different between the pulled schema and the updated schema that you backed up. Do a line by line diffcheck and see what has changed and try to push the changes one by one to see where it is failing. I think it is wiser to not push too many changes to the schema at once. Do it one by one so that you can troubleshoot more easily. If you do have other issues, then it should be unrelated to the one highlighted in this question, because the pulling should solve this particular issue.

like image 33
Ragav Y Avatar answered Sep 17 '22 09:09

Ragav Y