Cannot deregister AMIs

0

Hello,
I am trying to deregister some AMIs but get the message "An error occurred attempting to deregister AMIs".

I have always the error:
An error occurred attempting to deregister AMIs: ami-039588a247a38df94, ami-0ff70f11600db7631, ami-0ef749ad9b9710a24, ami-05abb644b1de5ab9b, ami-02c5fafc7d5d216df

Can you please help me?

Ronca
질문됨 3년 전2120회 조회
1개 답변
0

Hello,

Thanks for reaching out to us.

Checking on those AMIs, I can see that they were initially created by the AWS Backup service [1] because looking into the Cloudtrail logs for your account, I can see the below error when calling the DeregisterImage API call for those AMIs you mentioned
"errorMessage":"This image is managed by AWS Backup and cannot be deleted via EC2 APIs. To delete this image, please use the AWS Backup APIs, CLI, or console."

You may view that error message event using the Cloudtrail event logs in your CloudTrail Event History as well [2].

To delete those AMIs as per the error message, you need to use AWS Backup API calls or do it from AWS Backup console.

If you want to delete them from the AWS Backup console, please login to AWS Backup console:

Select Backup Vaults
Open the required vault
Select the intended recovery point
Press delete
Confirm
More information on deleting the images from the AWS Backup console can be found here [3]

If you want to delete them from the AWS CLI, you may use the delete-recovery-point API call [4] and provide the "backup vaults name" and the "recovery point ID" and delete the resource.
A sample cli command for reference would be:

aws backup delete-recovery-point --backup-vault-name <vault-name> --recovery-point-arn <arn of recovery point> --region us-west-2

I hope this helps.

Thanks and best regards,
awsabdallah

[1] AWS Backup service - https://aws.amazon.com/backup/

[2] Viewing Events with CloudTrail Event History - https://docs.aws.amazon.com/awscloudtrail/latest/userguide/view-cloudtrail-events.html

[3] Clean Up Resources - Step 3: Delete the Recovery Points - https://docs.aws.amazon.com/aws-backup/latest/devguide/gs-cleanup-resources.html#cleanup-backups

[4] Delete Recovery API cli - https://docs.aws.amazon.com/cli/latest/reference/backup/delete-recovery-point.html

Edited by: awsabdallah on Feb 8, 2021 5:21 AM

AWS
답변함 3년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠