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

Cannot delete Amplify backend after deleting bucket

Open davaya opened this issue 2 years ago • 13 comments

Is your feature request related to a problem? Please describe. Issue #2456 describes a console problem, the solution provided uses the CLI, and the issue was closed.

Describe the solution you'd like Console allows deleting amplify app without having to use CLI.

Additional context The Amplify All apps page shows apps as big smiley boxes. Clicking on an app shows "hosting environments" and "backend environments" with no details. "App Settings General" shows a few details: App name, Source repository, Production environment URL, App ARN, and creation/update info.

There is no <APP_ID>, <ENV_NAME>, or <PROFILE_NAME> as suggested in the closed issue (though the APP_ID is part of the ARN if you know where to look):

aws amplify delete-backend-environment --app-id <APP_ID> --environment-name <ENV_NAME> --profile <PROFILE_NAME>

The CLI aws amplify list-apps command shows "appId", "appArn", "name", "tags" etc (14 properties total), but no environment name or profile name. The amplify env list command says:

Current environment cannot be determined Use 'amplify init' in the root of your app directory to initialize your project with Amplify

Since "Amplify environments help you manage your local and cloud environments to mimic your team workflows" and the beginner tutorials don't suggest setting up team workflows, the console should delete an app even it it has the default environment.

Feature request: make the Amplify Console more like the EC2 or S3 Consoles - show full details about the resources being managed, and allow those resources to be managed from the console without invoking the CLI. The console error:

Delete backend dev failed with reason: ResourceNotFoundException - An error occurred while processing your request: S3 bucket amplify-amplifyhello-dev-110816-deployment or object #current-cloud-backend.zip was not found.

should be caught and the suggestion from the closed issue should be executed by the console. The console should delete an app even if its resources have already been deleted.

davaya avatar Apr 02 '22 19:04 davaya

I'm trying to cancel my account but there is an app that I cant delete because I have deleted the bucket amplify-amplifyapp-dev-111349-deployment.

alfonsson avatar Apr 03 '22 08:04 alfonsson

I also have this issue. I deleted the bucket and cannot delete the apps now (I have multiple like this).

amphi-live avatar Apr 07 '22 20:04 amphi-live

open AWS CloudShell and run cmd: aws amplify delete-app --app-id <your_app-id>

you can find amplify app id at amplify app detail

MiroslavZB avatar May 03 '22 19:05 MiroslavZB

Tried aws amplify delete-app --app-id d3bv93n8rb5o65 with the app-id, get this error:

"An error occurred (NotFoundException) when calling the DeleteApp operation: App d3bv93n8rb5o65 not found."

First app I used Studio with.

Attempt to delete from AWS Amplify Console (web): "Deletion failed ResourceNotFoundException - An error occurred while processing your request: Amplify meta file not found."

S3 bucket with #current-cloud-backend.zip and amplify-meta.json

roxberry avatar May 25 '22 03:05 roxberry

open AWS CloudShell and run cmd: aws amplify delete-app --app-id <your_app-id>

you can find amplify app id at amplify app detail

This worked for me!

thembimoyo2020 avatar Jun 06 '22 01:06 thembimoyo2020

this also worked for me. To find "amplify app detail", click on the name of the name of the app and click the dropdown arrow for "Edit Backend". The app id will follow the --appId flag:

image

amphi-live avatar Jun 06 '22 14:06 amphi-live

I hit this error too when trying to delete an app via the Amplify console (ResourceNotFoundException on the current-cloud-backend.zip) but in my case the bucket and zip file had never gotten created because I hit ctrl+c just after amplify init had started. Think the attempt to delete should be made more idempotent, and just continue if the bucket / zip don't exist. The aws amplify delete-app ... suggestion above worked for me too.

nedgar avatar Jun 07 '22 05:06 nedgar

"ap-northeast-2" region does not support AWS CloudShell

So I can't try. aws amplify delete-app --app-id <your_app-id>

Is there any other way?

znzlsh avatar Jun 20 '22 02:06 znzlsh

you can find amplify app id at amplify app detail

you can get your app id by running,

aws amplify list-apps

sravimohan avatar Jun 30 '22 22:06 sravimohan

open AWS CloudShell and run cmd: aws amplify delete-app --app-id <your_app-id>

you can find amplify app id at amplify app detail

Worked for me! Thanks.

Imperial-lord avatar Aug 21 '22 16:08 Imperial-lord

Thanks for all the info above. For anyone looking for a solution to delete an app created on a region that does not support AWS CloudShell, you can run the following: aws amplify delete-app --app-id <your-app-id> --region <application-region>

Where <your-app-id> is your app id and <application-region> is the region.

Your app id should be at the end of the amplify project arn: e.g: arn:aws:amplify:us-west-2:******:apps/d3595lz5byzxd5 d3595lz5byzxd5 is the app id.

Radu2k avatar Aug 24 '22 23:08 Radu2k

Thanks for all the info above. For anyone looking for a solution to delete an app created on a region that does not support AWS CloudShell, you can run the following: aws amplify delete-app --app-id <your-app-id> --region <application-region>

Where <your-app-id> is your app id and <application-region> is the region.

Your app id should be at the end of the amplify project arn: e.g: arn:aws:amplify:us-west-2:******:apps/d3595lz5byzxd5 d3595lz5byzxd5 is the app id.

Worked for me Thanks.

znzlsh avatar Aug 25 '22 01:08 znzlsh

Don't forget if you have multiple accounts to specify your --profile otherwise it is using the "default" profile.

For Example:

$ aws amplify delete-app --app-id dkx1ob4qfr5gz

An error occurred (NotFoundException) when calling the DeleteApp operation: App dkx1ob4qfr5gz not found.

$ aws amplify delete-app --app-id dkx1ob4qfr5gz --profile my-custom-org-account

You must specify a region. You can also configure your region by running "aws configure".

$ aws amplify delete-app --app-id dkx1ob4qfr5gz --profile vxlocate-prod-admin --region us-east-1

Cryoware avatar Aug 25 '22 20:08 Cryoware

When deleting via Amplify console, the error reported where the S3 bucket has been deleted out of band from Amplify commands has been fixed. You should be able to re-try deleting your app from Amplify console.

johnpc avatar Sep 27 '22 01:09 johnpc

Closing since this issue has been fixed.

Jay2113 avatar Feb 21 '24 21:02 Jay2113

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 Feb 21 '24 21:02 github-actions[bot]

This issue has been automatically locked.

github-actions[bot] avatar Feb 21 '24 22:02 github-actions[bot]