aws-amplify / amplify-hosting

AWS Amplify Hosting provides a Git-based workflow for deploying and hosting fullstack serverless web applications.
https://aws.amazon.com/amplify/hosting/
Apache License 2.0
461 stars 116 forks source link

Can't delete my Amplify App #2887

Closed jigr-web-services closed 2 years ago

jigr-web-services commented 2 years ago

Before opening, please confirm:

App Id

d26h9qcsu15zer

Region

us-west-2

Amplify Hosting feature

Not applicable

Describe the bug

I want to delete this App from my Amplify console. But everytime I do, I get this error:

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

I had accidentally deleted the bucket it mentions. But now I am stuck with it...

Expected behavior

Delete the Amplify app

Reproduction steps

  1. Login to AWS Console
  2. Go to AWS Amplify
  3. Go to All Apps, and click the App thumbnail I want to delete
  4. Click "Delete App" under the top right "Actions" menu

Build Settings

No response

Additional information

No response

ghost commented 2 years ago

Hi @jigr-web-services can you try running: aws amplify delete-backend-environment --app-id <appID> --environment-name <backend env name>

After this you can go back into the console and delete the app again.

Please let us know if this is not successful.

jigr-web-services commented 2 years ago

Thanks @hloriana. I tried to try this command on CloudShell. I get this Unable to start the environment. To retry, refresh the browser or restart by selecting Actions, Restart AWS CloudShell. System error: Environment was in state: CREATION_FAILED. Expected environment to be in state: RUNNING. To retry, refresh the browser or restart by selecting Actions, Restart AWS CloudShell. Then I also tried to restart the CloudShell, no luck. I also deleted CloudShell home directory and tried again, no luck either.

Not sure what's wrong with the account. Now I'll try on AWS CLI on my machine.

jigr-web-services commented 2 years ago

I tried using aws CLI v2 and it worked. I used aws amplify delete-app --app-id <app-id> --profile <aws-profie>. I had to assign AdministratorAccess-Amplify and a custom policy to IAM user for aws profile.

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "VisualEditor0",
            "Effect": "Allow",
            "Action": "amplify:DeleteApp",
            "Resource": "*"
        }
    ]
}
ghost commented 2 years ago

Awesome! We are already tracking this bug in our product backlog.

Closing as duplicate of: https://github.com/aws-amplify/amplify-hosting/issues/2548. Feel free to track progress for the bug fix on that issue.

github-actions[bot] commented 2 years ago

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.

johnpc commented 2 years ago

When deleting via Amplify console, the error reported

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

has been fixed. you should be able to re-try deleting your app from Amplify console.

github-actions[bot] commented 2 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.