I built an Amplify sample application following this workshop.
Afterwards, I manually deleted CloudFormation stacks (from the AWS console - selected root stack and executed delete stack action) hoping that I can rebuild them using amplify push
. Unfortunately, amplify reports no changes and do not rebuild stacks. Is there a way to force amplify to provision the resources?
amplify cli checks diff between amplify/#current-cloud-backend
and amplify/backend
folder inside your project. It doesn't check what is currently deployed in the cloud.
Since you have deleted the root stack, even if there were any changes to push, it would fail as the stack is missing. To recover from this error you can run amplify init
and and when asked Do you want to use an existing environment?
select No
. This will recreate the root stack and will allow you to push your changes.
PS: Multi environment support is available in amplify cli version 1 and above. If its pre v1
init command won't work
If you delete a function or an API which other resources depend on, this could lead to the push to fail. So what I usually do, is to recreate the same function or API and push it again. It's a provisional hack I use, but I think there could be a better one.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With