Note: If your question is regarding the AWS Amplify Console service, please log it in the
official AWS Amplify Console forum
Which Category is your question related to?
Amplify CLI
Amplify CLI Version
You can use amplify -v
to check the amplify CLI version on your system
4.4.0
What AWS Services are you utilizing?
Amplify env
Provide additional details e.g. code snippets
I have two environments that I want to remove: dev and test. the issue is that I have manually removed their root stack from cloud formation. and now when I run amplify env remove dev or test I get root stack doesn't exist.
How can I recover my project without losing my prod env?
@oahmaro amplify maintains information about the environments in a <proj-root>/amplify/team-provider-info.json
file. Here you should see a list of environments and the resource details for this environment. If you have removed the root stack dev
and test
from this file, these environment should not be shown when you run amplify env list
. Please make sure you're not currently in dev
or test
environment when you're editing the team-provider-info.json
file.
Please feel free to re-open or comment if the issue still persists.
I have deleted the env and list env from team-provider-info.json while I am on a different env. but when I try to recreate let's say test env I get the following error: Note: It is recommended to run this command from the root of your app directory
? Do you want to use an existing environment? No
? Enter a name for the environment test
Using default provider awscloudformation
init failed
TypeError: Cannot read property 'configLevel' of undefined
at Object.getAwsConfig (C:\Users\Osama\AppData\Roaming\npm\node_modules\@aws-amplify\cli\node_modules\amplify-provider-awscloudformation\lib\configuration-manager.js:633:21)
at Object.run (C:\Users\Osama\AppData\Roaming\npm\node_modules\@aws-amplify\cli\node_modules\amplify-provider-awscloudformation\lib\initializer.js:22:50)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
I have deleted the env from local-aws-info.json, and now when I try to create a new env called test it actually works but now it creates a duplicate project with the same name as the original project on amplify console. it doesn't add to the existing project.
I have managed to solve this by using the same amplifyAppId the amplify console had. and use it on a file called team-provider-info.json. i am not sure if i should edit this file manually but it solved it for me.
I am getting the same issue. I had to delete cloud formation stack manually in hope that it will fix Unexpected token o in JSON at position 0
that I was encountering on amplify push
. Now I have a prod
environment in amplify console and I cannot find a way to delete it.
Same problem for me, how can we delete Amplify environments when the stack is gone and the enviroment was not created via cli but via console?
I have just been able to do it using the cli
aws amplify delete-backend-environment --app-id
@samkos YEEEEEEES. THANK YOU!
Most helpful comment
I have just been able to do it using the cli
aws amplify delete-backend-environment --app-id --environment-name