How to find cost of untagged resources in AWS using Cost explorer API

789 Views Asked by At

We have 2 mandatory tags for every resource in AWS, we want to find the cost of the untagged resources, how is it possible to get the cost for the untagged resources ?

I checked through the Cost explorer API docs but didn't get much for untagged cost finding, any suggestions ?

Thank you !

2

There are 2 best solutions below

0
On

As per Cost Explorer API documentation this specific filter that there should not be any other tag except the 2 mandatory tags is not possible. But we can do it other way round by applying filter on response from API.

1
On

If you're using Python, you can use this:

{
    "Tags": {
        "Key": "squad",
        "MatchOptions": ["ABSENT"]
    }
},