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?

已提问 2 年前1357 查看次数
2 回答
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
支持工程师
已回答 2 年前
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?

已回答 2 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则