By using AWS re:Post, you agree to the Terms of Use

Only get existing resources with ResourceGroupTaggingAPI


I am using the AWS ResourceGroupTagginApi (the get-resources command, to list all my resources in my account and check if the tags are setup as I want to.

No I notice that the get-resources command also returns resources, that I have already deleted.

The advantage of the ResourceGroupTagginApi for me is, that I can get all resources and there tags using one command, and I don't have to call the service specific apis (which I would have to implement for every service separately).

How can I only return resources that have not been deleted? Or how can I filter the resources out, that have already been deleted without using the service specific APIs?

  • I have the same problem. With resourcegroupstaggingapi get-resources I get backup plans that have been deleted. And when I try to retag or remove them I get the error 400 ResourceNotFoundException. From the console I don't see those plans neither from Tag Editor nor AWS Backup.

2 Answers


I understand that when running the command “aws resourcegroupstaggingapi get-resources” you are getting resources in the output that have already been deleted.

Testing in my account this command only shows resources that still exist. I was able to test with several different resources and every time they were deleted they no longer showed up in the command. If you notice that there is a specific resource that you have deleted which is still appearing in the results of the CLI command I would recommend opening an AWS support ticket. There an engineer can help troubleshoot the specific issue.

I hope you have a great rest of your day!

answered 6 months ago

I am having the same issue with EC2 snapshots. Even though the snapshot has been deleted for hours I am still able to see it return on the aws resourcegroupstaggingapi get-resources. We do not have a support plan, how can we understand the issue?

answered 5 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions