Only get existing resources with ResourceGroupTaggingAPI

2

I am using the AWS ResourceGroupTagginApi (the get-resources command, https://docs.aws.amazon.com/cli/latest/reference/resourcegroupstaggingapi/get-resources.html) 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.

  • Hello, I'm having the same issue, resourcegroupstaggingapi is returning unexisting or previously deleted resources. Our workflow is very elastic so lots of resources are created and deleted throughout the day, so maybe this is expected. But I'm concerned with the cost implications of having deleted resources reported by this API. Has anybody been able to fix this?

asked 2 years ago1342 views
2 Answers
0

Hi,

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!

AWS
SUPPORT ENGINEER
answered 2 years ago
0

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 2 years 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